X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=thumb.php;h=ede30e6ec4feeaa4133fc3e75cf442ed3393cd4d;hb=86ce0ee506b46079255ab7cfdf07f7b18ba2f470;hp=f1d5341fc2b2bc0c2d6e979bc53744ea1b7c724d;hpb=97e0ea2710865b1ce265d46152de939c650effa5;p=lhc%2Fweb%2Fwiklou.git diff --git a/thumb.php b/thumb.php index f1d5341fc2..ede30e6ec4 100644 --- a/thumb.php +++ b/thumb.php @@ -170,11 +170,11 @@ function wfStreamThumb( array $params ) { // Check the source file storage path if ( !$img->exists() ) { - wfThumbError( 404, 'The source file for the specified thumbnail does not exist.' ); + wfThumbError( 404, "The source file '$fileName' does not exist." ); wfProfileOut( __METHOD__ ); return; } elseif ( $img->getPath() === false ) { - wfThumbError( 500, 'The source file is not locally accessible.' ); + wfThumbError( 500, "The source file '$fileName' is not locally accessible." ); wfProfileOut( __METHOD__ ); return; } @@ -215,16 +215,16 @@ function wfStreamThumb( array $params ) { // Check that the zone relative path matches up so squid caches won't pick // up thumbs that would not be purged on source file deletion (bug 34231). if ( isset( $params['rel404'] ) ) { // thumbnail was handled via 404 - if ( urldecode( $params['rel404'] ) === $img->getThumbRel( $thumbName ) ) { + if ( rawurldecode( $params['rel404'] ) === $img->getThumbRel( $thumbName ) ) { // Request for the canonical thumbnail name - } elseif ( urldecode( $params['rel404'] ) === $img->getThumbRel( $thumbName2 ) ) { + } elseif ( rawurldecode( $params['rel404'] ) === $img->getThumbRel( $thumbName2 ) ) { // Request for the "long" thumbnail name; redirect to canonical name $response = RequestContext::getMain()->getRequest()->response(); $response->header( "HTTP/1.1 301 " . HttpStatus::getMessage( 301 ) ); $response->header( 'Location: ' . wfExpandUrl( $img->getThumbUrl( $thumbName ), PROTO_CURRENT ) ); $response->header( 'Expires: ' . - gmdate( 'D, d M Y H:i:s', time() + 7*86400 ) . ' GMT' ); + gmdate( 'D, d M Y H:i:s', time() + 7 * 86400 ) . ' GMT' ); if ( $wgVaryOnXFP ) { $varyHeader[] = 'X-Forwarded-Proto'; } @@ -234,7 +234,9 @@ function wfStreamThumb( array $params ) { wfProfileOut( __METHOD__ ); return; } else { - wfThumbError( 404, 'The given path of the specified thumbnail is incorrect.' ); + wfThumbError( 404, "The given path of the specified thumbnail is incorrect; + expected '" . $img->getThumbRel( $thumbName ) . "' but got '" . + rawurldecode( $params['rel404'] ) . "'." ); wfProfileOut( __METHOD__ ); return; } @@ -362,7 +364,7 @@ function wfThumbError( $status, $msg ) { $hostname = htmlspecialchars( wfHostname() ); $debug = "\n\n"; } else { - $debug = ""; + $debug = ''; } echo <<Error generating thumbnail