From: Aaron Schulz Date: Sat, 24 Nov 2012 23:47:17 +0000 (-0800) Subject: (bug 42302) Fixed broken thumbnails for files with a "+" in the name. X-Git-Tag: 1.31.0-rc.0~21518^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=dfe02f371be76b236a0af9028f52584bef04a427;p=lhc%2Fweb%2Fwiklou.git (bug 42302) Fixed broken thumbnails for files with a "+" in the name. Change-Id: Ic5764fa17e12d24ddbc77bfc0523e97ed12b0afe --- diff --git a/thumb.php b/thumb.php index f1d5341fc2..f59ee0f8ff 100644 --- a/thumb.php +++ b/thumb.php @@ -215,9 +215,9 @@ 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 ) ); @@ -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; }