Index: trunk/extensions/Filepath/SpecialFilepath_body.php |
— | — | @@ -22,20 +22,22 @@ |
23 | 23 | |
24 | 24 | $title = Title::makeTitleSafe( NS_IMAGE, $file ); |
25 | 25 | |
26 | | - if ( ! is_null( $title ) && ! $title->exists() ) { |
27 | | - $wgOut->setStatusCode( 404 ); |
| 26 | + if ( is_null( $title ) ) { |
28 | 27 | $this->setHeaders(); |
29 | 28 | $this->outputHeader(); |
30 | 29 | $cform = new FilepathForm( $title ); |
31 | 30 | $cform->execute(); |
32 | | - } else if ( is_null( $title ) ) { |
33 | | - $this->setHeaders(); |
34 | | - $this->outputHeader(); |
35 | | - $cform = new FilepathForm( $title ); |
36 | | - $cform->execute(); |
37 | 31 | } else { |
38 | 32 | $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 | + } |
40 | 42 | } |
41 | 43 | } |
42 | 44 | } |