X-Git-Url: https://git.sesse.net/?p=pr0n;a=blobdiff_plain;f=perl%2FSesse%2Fpr0n%2FImage.pm;h=6a4f7a80e71a64f2653d1a2d5d596a04c065aa18;hp=4f6360a6605f001b1e3a5ace4fc8494490c0f785;hb=c53dd5ce79ebfdcf01c3847149611ebafcebdd69;hpb=d5489e1aa91408c7b89766adfe269849d587cf9a diff --git a/perl/Sesse/pr0n/Image.pm b/perl/Sesse/pr0n/Image.pm index 4f6360a..6a4f7a8 100644 --- a/perl/Sesse/pr0n/Image.pm +++ b/perl/Sesse/pr0n/Image.pm @@ -13,29 +13,26 @@ sub handler { # die "Har du lest FAQen?"; # } - # Find the event and file name + # Find the event and file name (nobox/ is for compatibility with legacy URLs). my ($event,$filename,$xres,$yres,$dpr); - my $infobox = 'both'; + my $infobox = 0; if ($r->path_info =~ m#^/([a-zA-Z0-9-]+)/original/((?:no)?box/)?([a-zA-Z0-9._()-]+)$#) { $event = $1; $filename = $3; - $infobox = 'nobox' if (defined($2) && $2 eq 'nobox/'); - $infobox = 'box' if (defined($2) && $2 eq 'box/'); + $infobox = 1 if (defined($2) && $2 eq 'box/'); } elsif ($r->path_info =~ m#^/([a-zA-Z0-9-]+)/(\d+)x(\d+)(?:\@(\d+(?:\.\d+)?))?/((?:no)?box/)?([a-zA-Z0-9._()-]+)$#) { $event = $1; $filename = $6; $xres = $2; $yres = $3; $dpr = $4; - $infobox = 'nobox' if (defined($5) && $5 eq 'nobox/'); - $infobox = 'box' if (defined($5) && $5 eq 'box/'); + $infobox = 1 if (defined($5) && $5 eq 'box/'); } elsif ($r->path_info =~ m#^/([a-zA-Z0-9-]+)/((?:no)?box/)?([a-zA-Z0-9._()-]+)$#) { $event = $1; $filename = $3; $xres = -1; $yres = -1; - $infobox = 'nobox' if (defined($2) && $2 eq 'nobox/'); - $infobox = 'box' if (defined($2) && $2 eq 'box/'); + $infobox = 1 if (defined($2) && $2 eq 'box/'); } $dpr //= 1;