From: Aaron Schulz Date: Thu, 29 Aug 2013 20:31:12 +0000 (-0700) Subject: Simplified some code and broke lines in thumb.php X-Git-Tag: 1.31.0-rc.0~18708^2 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=7e9f8ec1df148fc75fa1f48b42a3ef95286e4bfe;p=lhc%2Fweb%2Fwiklou.git Simplified some code and broke lines in thumb.php Change-Id: I99fc63ab473a3f2fe33e0227e5e283e0c195f01b --- diff --git a/thumb.php b/thumb.php index 2b68927834..2cda3441f4 100644 --- a/thumb.php +++ b/thumb.php @@ -171,20 +171,17 @@ function wfStreamThumb( array $params ) { $redirectedLocation = false; if ( !$isTemp ) { // Check for file redirect - if ( $isOld ) { - // Since redirects are associated with pages, not versions of files, - // we look for the most current version to see if its a redirect. - $possibleRedirFile = RepoGroup::singleton()->getLocalRepo()->findFile( $img->getName() ); - } else { - $possibleRedirFile = RepoGroup::singleton()->getLocalRepo()->findFile( $fileName ); - } - if ( $possibleRedirFile && !is_null( $possibleRedirFile->getRedirected() ) ) { - $redirTarget = $possibleRedirFile->getName(); + // Since redirects are associated with pages, not versions of files, + // we look for the most current version to see if its a redirect. + $possRedirFile = RepoGroup::singleton()->getLocalRepo()->findFile( $img->getName() ); + if ( $possRedirFile && !is_null( $possRedirFile->getRedirected() ) ) { + $redirTarget = $possRedirFile->getName(); $targetFile = wfLocalFile( Title::makeTitleSafe( NS_FILE, $redirTarget ) ); if ( $targetFile->exists() ) { $newThumbName = $targetFile->thumbName( $params ); if ( $isOld ) { - $newThumbUrl = $targetFile->getArchiveThumbUrl( $bits[0] . '!' . $targetFile->getName(), $newThumbName ); + $newThumbUrl = $targetFile->getArchiveThumbUrl( + $bits[0] . '!' . $targetFile->getName(), $newThumbName ); } else { $newThumbUrl = $targetFile->getThumbUrl( $newThumbName ); }