X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_del%27%2C%20idvote=vote.voteid%29%20%7D%7D?a=blobdiff_plain;f=thumb.php;h=50d3754da90d993824df7fa0cc9e2200a3cd3030;hb=e476f5f432412f1e94c1dcb7091f1757986457e2;hp=eb0d67df191badd7d240bdd4506a2699bbbc399a;hpb=356799f95a8cc919b1a4d197d6b9e1041d849173;p=lhc%2Fweb%2Fwiklou.git diff --git a/thumb.php b/thumb.php index eb0d67df19..50d3754da9 100644 --- a/thumb.php +++ b/thumb.php @@ -1,14 +1,29 @@ getLocalRepo()->newFromArchiveName( $title, $fileName ); + } elseif ( $isTemp ) { + $repo = RepoGroup::singleton()->getLocalRepo()->getTempRepo(); + // Format is ! or just + $bits = explode( '!', $fileName, 2 ); + // Get the name without the timestamp so hash paths are correctly computed + $title = Title::makeTitleSafe( NS_FILE, isset( $bits[1] ) ? $bits[1] : $fileName ); + if ( !$title ) { + wfThumbError( 404, wfMsg( 'badtitletext' ) ); + wfProfileOut( __METHOD__ ); + return; + } + $img = new UnregisteredLocalFile( $title, $repo, + $repo->getZonePath( 'public' ) . '/' . $repo->getTempHashPath( $fileName ) . $fileName + ); } else { $img = wfLocalFile( $fileName ); } @@ -178,7 +211,7 @@ 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 - && urldecode( $params['rel404'] ) !== $img->getThumbRel( $thumbName ) ) + && urldecode( $params['rel404'] ) !== $img->getThumbRel( $thumbName ) ) { wfThumbError( 404, 'The source file for the specified thumbnail does not exist.' ); wfProfileOut( __METHOD__ );