Index: trunk/extensions/ImageMap/ImageMap_body.php |
— | — | @@ -83,8 +83,8 @@ |
84 | 84 | $thumbWidth = $imageNode->getAttribute('width'); |
85 | 85 | $thumbHeight = $imageNode->getAttribute('height'); |
86 | 86 | |
87 | | - $imageObj = function_exists( 'wfFindFile' ) ? wfFindFile( $imageTitle ) : new Image( $imageTitle ); |
88 | | - if ( !$imageObj || !$imageObj->exists() ) { |
| 87 | + $imageObj = Image::newFromTitle( $imageTitle ); |
| 88 | + if ( !$imageObj->exists() ) { |
89 | 89 | return self::error( 'imagemap_invalid_image' ); |
90 | 90 | } |
91 | 91 | # Add the linear dimensions to avoid inaccuracy in the scale |
Index: trunk/extensions/SmoothGallery/SmoothGallery.php |
— | — | @@ -215,9 +215,9 @@ |
216 | 216 | |
217 | 217 | foreach ( $title_arr as $title ) { |
218 | 218 | //Get the image object from the database |
219 | | - $img_obj = function_exists( 'wfFindFile' ) ? wfFindFile( $title ) : new Image( $title ); |
| 219 | + $img_obj = Image::newFromTitle( $title ); |
220 | 220 | |
221 | | - if ( !$img_obj || !$img_obj->exists() ) { |
| 221 | + if ( !$img_obj->exists() ) { |
222 | 222 | //The user asked for an image that doesn't exist, let's |
223 | 223 | //add this to the list of missing objects and not output |
224 | 224 | //any html |
Index: trunk/extensions/FileSearch/FileSearchIndexer.php |
— | — | @@ -47,8 +47,8 @@ |
48 | 48 | if( $namespace == NS_IMAGE ) { |
49 | 49 | wfDebugLog( 'filesearch', "Update called for `{$title}`" ); |
50 | 50 | $titleObj = Title::makeTitle( NS_IMAGE, $title ); |
51 | | - $image = function_exists( 'wfFindFile' ) ? wfFindFile( $titleObj ) : new Image( $titleObj ); |
52 | | - if ( !$image || !$image->exists() ) { |
| 51 | + $image = Image::newFromTitle( $titleObj ); |
| 52 | + if ( !$image->exists() ) { |
53 | 53 | wfDebugLog( 'filesearch', "Image does not exist: $title" ); |
54 | 54 | return; |
55 | 55 | } |
Index: trunk/extensions/Player/PlayerClass.php |
— | — | @@ -49,8 +49,8 @@ |
50 | 50 | static function newFromTitle( $title, $options, $sizeDefault = 'imagesize' ) { |
51 | 51 | loadPlayerI18n(); |
52 | 52 | |
53 | | - $image = function_exists( 'wfFindFile' ) ? wfFindFile( $title ) : new Image( $title ); |
54 | | - if ( !$image || !$image->exists() ) { |
| 53 | + $image = Image::newFromTitle( $title ); |
| 54 | + if ( !$image->exists() ) { |
55 | 55 | throw new PlayerException(wfMsg("player-not-found"), 404); |
56 | 56 | } |
57 | 57 | |
Index: trunk/extensions/Logo/Logo.php |
— | — | @@ -23,8 +23,8 @@ |
24 | 24 | if( is_object( $title ) ) { |
25 | 25 | if( $title->getNamespace() != NS_IMAGE ) |
26 | 26 | $title = Title::makeTitle( NS_IMAGE, $title->getText() ); |
27 | | - $logo = function_exists( 'wfFindFile' ) ? wfFindFile( $title ) : new Image( $title ); |
28 | | - if( $logo && $logo->exists() ) |
| 27 | + $logo = Image::newFromTitle( $title ); |
| 28 | + if( $logo->exists() ) |
29 | 29 | $wgLogo = $wgLogoAutoScale ? $logo->createThumb( 135 ) : $logo->getUrl(); |
30 | 30 | } |
31 | 31 | } |
Index: trunk/extensions/ProofreadPage/ProofreadPage.php |
— | — | @@ -108,8 +108,8 @@ |
109 | 109 | return true; |
110 | 110 | } |
111 | 111 | |
112 | | - $image = function_exists( 'wfFindFile' ) ? wfFindFile( $imageTitle ) : new Image( $imageTitle ); |
113 | | - if ( $image && $image->exists() ) { |
| 112 | + $image = Image::newFromTitle( $imageTitle ); |
| 113 | + if ( $image->exists() ) { |
114 | 114 | $width = intval( $image->getWidth() ); |
115 | 115 | $height = intval( $image->getHeight() ); |
116 | 116 | if($m[2]) { |
Index: trunk/extensions/PicturePopup/PicturePopup_body.php |
— | — | @@ -64,8 +64,8 @@ |
65 | 65 | } |
66 | 66 | |
67 | 67 | function ajaxNoCache( $sizeSel ) { |
68 | | - $image = function_exists( 'wfFindFile' ) ? wfFindFile( $this->mTitle ) : new Image( $this->mTitle ); |
69 | | - if ( !$image || !$image->exists() ) { |
| 68 | + $image = Image::newFromTitle( $this->mTitle ); |
| 69 | + if ( !$image->exists() ) { |
70 | 70 | return self::jsonError( 'picturepopup_no_image' ); |
71 | 71 | } |
72 | 72 | $licenseData = $this->getImageLicenseMetadata( $this->mTitle ); |
Index: trunk/extensions/Filepath/SpecialFilepath_body.php |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | $cform = new FilepathForm( $title ); |
30 | 30 | $cform->execute(); |
31 | 31 | } else { |
32 | | - $file = function_exists( 'wfFindFile' ) ? wfFindFile( $title ) : new Image( $title ); |
| 32 | + $file = Image::newFromTitle( $title ); |
33 | 33 | if ( $file && $file->exists() ) { |
34 | 34 | $wgOut->redirect( $file->getURL() ); |
35 | 35 | } else { |
Index: trunk/extensions/News/NewsRenderer.php |
— | — | @@ -613,7 +613,10 @@ |
614 | 614 | |
615 | 615 | $ticon = $icon ? Title::newFromText($icon, NS_IMAGE) : NULL; |
616 | 616 | if ( $ticon ) { |
617 | | - $image = function_exists( 'wfFindFile' ) ? wfFindFile( $ticon ) : new Image( $ticon ); |
| 617 | + $image = Image::newFromTitle( $ticon ); |
| 618 | + if ( !$image->exists() ) { |
| 619 | + $image = false; |
| 620 | + } |
618 | 621 | } else { |
619 | 622 | $image = false; |
620 | 623 | } |