]> git.sesse.net Git - pr0n/blobdiff - perl/Sesse/pr0n/Common.pm
Make /select purge cache.
[pr0n] / perl / Sesse / pr0n / Common.pm
index dc8813c2fc65d8506635586d54b82cea2a36af1f..d325907b71395e57298499b8718c9f5f8f480a64 100644 (file)
@@ -39,7 +39,7 @@ BEGIN {
                require Sesse::pr0n::Config_local;
        };
 
-       $VERSION     = "v2.70";
+       $VERSION     = "v2.71";
        @ISA         = qw(Exporter);
        @EXPORT      = qw(&error &dberror);
        %EXPORT_TAGS = qw();
@@ -338,7 +338,8 @@ sub output_401 {
        $r->status(401);
        $r->headers_out->{'www-authenticate'} = 'Basic realm="pr0n.sesse.net"';
 
-       if ($options{'DigestAuth'} // 1) {
+       # Digest auth is disabled for now, due to various client problems.
+       if (0 && ($options{'DigestAuth'} // 1)) {
                # We make our nonce similar to the scheme of RFC2069 section 2.1.1,
                # with some changes: We don't care about client IP (these have a nasty
                # tendency to change from request to request when load-balancing
@@ -705,7 +706,7 @@ sub ensure_cached {
 
        my $fname = get_disk_location($r, $id);
        if ($infobox ne 'box') {
-               unless (defined($xres) && (!defined($dbwidth) || !defined($dbheight) || $xres < $dbheight || $yres < $dbwidth || $xres == -1)) {
+               unless (defined($xres) && (!defined($dbwidth) || !defined($dbheight) || $xres < $dbwidth || $yres < $dbheight || $xres == -1)) {
                        return ($fname, undef);
                }
        }
@@ -878,7 +879,7 @@ sub make_infobox {
                my ($a, $b) = ($1, $2);
                my $gcd = gcd($a, $b);
                push @classic_fields, [ $a/$gcd . "/" . $b/$gcd . "s", $shutter_priority ];
-       } elsif (defined($info->{'ExposureTime'}) && $info->{'ExposureTime'} =~ /^(\d+(?:\.\d+))$/) {
+       } elsif (defined($info->{'ExposureTime'}) && $info->{'ExposureTime'} =~ /^(\d+(?:\.\d+)?)$/) {
                push @classic_fields, [ $1 . "s", $shutter_priority ];
        }
 
@@ -914,7 +915,7 @@ sub make_infobox {
 
        if (defined($info->{'ExposureBiasValue'}) && $info->{'ExposureBiasValue'} ne "0") {
                push @classic_fields, [ $info->{'ExposureBiasValue'} . " EV", 0 ];
-       } elsif (defined($info->{'ExposureCompensation'}) && $info->{'ExposureCompensation'} != 0) {
+       } elsif (defined($info->{'ExposureCompensation'}) && $info->{'ExposureCompensation'} ne "0") {
                push @classic_fields, [ $info->{'ExposureCompensation'} . " EV", 0 ];
        }