Fix the pr0n.pm regex for image URLs with no /WxH/ or /original.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 19 Nov 2015 18:29:01 +0000 (19:29 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 19 Nov 2015 18:29:01 +0000 (19:29 +0100)
perl/Sesse/pr0n/pr0n.pm

index f10f9f41633599ebc592936a92ef72ce08648cb5..54e55be8270f43ca12c42f89b262e3d59b91c053 100644 (file)
@@ -69,7 +69,10 @@ sub handler {
        } elsif ($uri =~ /^\/[a-zA-Z0-9-]+\/?$/ ||
                 $uri =~ /^\/\+all\/?$/) {
                return Sesse::pr0n::Index::handler($r);
        } elsif ($uri =~ /^\/[a-zA-Z0-9-]+\/?$/ ||
                 $uri =~ /^\/\+all\/?$/) {
                return Sesse::pr0n::Index::handler($r);
-       } elsif ($uri =~ m#^/[a-zA-Z0-9-]+/(\d+x\d+(\@\d+(\.\d+)?)?/|original/)((?:no)?box/)?[a-zA-Z0-9._()-]+$#) {
+       } elsif ($uri =~ m#^/[a-zA-Z0-9-]+/
+                          (\d+x\d+ ( \@\d+(\.\d+)? )? / | original/ )?
+                           ((?:no)?box/)?
+                           [a-zA-Z0-9._()-]+$#x) {
                return Sesse::pr0n::Image::handler($r);
        }
 
                return Sesse::pr0n::Image::handler($r);
        }