From af5eed753fccf3c6976f96c2cfd5f735dd229e26 Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Wed, 19 Jan 2011 01:03:39 +0000 Subject: [PATCH] Quick adjustments to the if-block layout in r80381 to make the way the code works clearer --- includes/specials/SpecialFilepath.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 ); -- 2.20.1