r21633 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r21632‎ | r21633 | r21634 >
Date:19:05, 26 April 2007
Author:brion
Status:old
Tags:
Comment:
* (bug 9686) Return Special:Filepath results for shared images and images with missing description page
Modified paths:
  • /trunk/extensions/Filepath/SpecialFilepath_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Filepath/SpecialFilepath_body.php
@@ -22,20 +22,22 @@
2323
2424 $title = Title::makeTitleSafe( NS_IMAGE, $file );
2525
26 - if ( ! is_null( $title ) && ! $title->exists() ) {
27 - $wgOut->setStatusCode( 404 );
 26+ if ( is_null( $title ) ) {
2827 $this->setHeaders();
2928 $this->outputHeader();
3029 $cform = new FilepathForm( $title );
3130 $cform->execute();
32 - } else if ( is_null( $title ) ) {
33 - $this->setHeaders();
34 - $this->outputHeader();
35 - $cform = new FilepathForm( $title );
36 - $cform->execute();
3731 } else {
3832 $file = new Image( $title );
39 - $wgOut->redirect( $file->getURL() );
 33+ if ( $file->exists() ) {
 34+ $wgOut->redirect( $file->getURL() );
 35+ } else {
 36+ $wgOut->setStatusCode( 404 );
 37+ $this->setHeaders();
 38+ $this->outputHeader();
 39+ $cform = new FilepathForm( $title );
 40+ $cform->execute();
 41+ }
4042 }
4143 }
4244 }