From: Andrew Garrett Date: Wed, 19 Jan 2011 01:03:39 +0000 (+0000) Subject: Quick adjustments to the if-block layout in r80381 to make the way the code works... X-Git-Tag: 1.31.0-rc.0~32480 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=af5eed753fccf3c6976f96c2cfd5f735dd229e26;p=lhc%2Fweb%2Fwiklou.git Quick adjustments to the if-block layout in r80381 to make the way the code works clearer --- diff --git a/includes/specials/SpecialFilepath.php b/includes/specials/SpecialFilepath.php index 8bb0890c6c..cb3bb49a7b 100644 --- a/includes/specials/SpecialFilepath.php +++ b/includes/specials/SpecialFilepath.php @@ -47,15 +47,18 @@ class SpecialFilepath extends SpecialPage { } else { $file = wfFindFile( $title ); if ( $file && $file->exists() ) { - $url = $file->getURL(); $width = $wgRequest->getInt( 'width', -1 ); $height = $wgRequest->getInt( 'height', -1 ); + if ( $width != -1 ) { $mto = $file->transform( array( 'width' => $width, 'height' => $height ) ); if ( $mto && !$mto->isError() ) { $url = $mto->getURL(); } + } else { + $url = $file->getURL(); } + $wgOut->redirect( $url ); } else { $wgOut->setStatusCode( 404 );