r80546 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80545‎ | r80546 | r80547 >
Date:01:10, 19 January 2011
Author:werdna
Status:ok
Tags:
Comment:
Revert r80544 -- need to handle the case in which there is an error
Modified paths:
  • /trunk/phase3/includes/specials/SpecialFilepath.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialFilepath.php
@@ -46,19 +46,21 @@
4747 $this->showForm( $title );
4848 } else {
4949 $file = wfFindFile( $title );
 50+
5051 if ( $file && $file->exists() ) {
 52+ // Default behaviour: Use the direct link to the file.
 53+ $url = $file->getURL();
5154 $width = $wgRequest->getInt( 'width', -1 );
5255 $height = $wgRequest->getInt( 'height', -1 );
5356
5457 if ( $width != -1 ) {
 58+ // If we can, and it's requested,
 59+ // change the URL to point to a thumbnail.
5560 $mto = $file->transform( array( 'width' => $width, 'height' => $height ) );
5661 if ( $mto && !$mto->isError() ) {
5762 $url = $mto->getURL();
5863 }
59 - } else {
60 - $url = $file->getURL();
6164 }
62 -
6365 $wgOut->redirect( $url );
6466 } else {
6567 $wgOut->setStatusCode( 404 );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r80544Quick adjustments to the if-block layout in r80381 to make the way the code w...werdna01:03, 19 January 2011

Status & tagging log