Quick adjustments to the if-block layout in r80381 to make the way the code works...
authorAndrew Garrett <werdna@users.mediawiki.org>
Wed, 19 Jan 2011 01:03:39 +0000 (01:03 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Wed, 19 Jan 2011 01:03:39 +0000 (01:03 +0000)
includes/specials/SpecialFilepath.php

index 8bb0890..cb3bb49 100644 (file)
@@ -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 );