r80544 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80543‎ | r80544 | r80545 >
Date:01:03, 19 January 2011
Author:werdna
Status:reverted
Tags:
Comment:
Quick adjustments to the if-block layout in r80381 to make the way the code works clearer
Modified paths:
  • /trunk/phase3/includes/specials/SpecialFilepath.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialFilepath.php
@@ -47,15 +47,18 @@
4848 } else {
4949 $file = wfFindFile( $title );
5050 if ( $file && $file->exists() ) {
51 - $url = $file->getURL();
5251 $width = $wgRequest->getInt( 'width', -1 );
5352 $height = $wgRequest->getInt( 'height', -1 );
 53+
5454 if ( $width != -1 ) {
5555 $mto = $file->transform( array( 'width' => $width, 'height' => $height ) );
5656 if ( $mto && !$mto->isError() ) {
5757 $url = $mto->getURL();
5858 }
 59+ } else {
 60+ $url = $file->getURL();
5961 }
 62+
6063 $wgOut->redirect( $url );
6164 } else {
6265 $wgOut->setStatusCode( 404 );

Follow-up revisions

RevisionCommit summaryAuthorDate
r80546Revert r80544 -- need to handle the case in which there is an errorwerdna01:10, 19 January 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r80381Add width parameter to Special:Filepath to allow getting the file path of a t...catrope11:20, 15 January 2011

Status & tagging log