Index: trunk/extensions/ImageMap/ImageMap_body.php |
— | — | @@ -80,8 +80,13 @@ |
81 | 81 | $thumbWidth = $imageNode->getAttribute('width'); |
82 | 82 | $thumbHeight = $imageNode->getAttribute('height'); |
83 | 83 | |
84 | | - $imageObj = Image::newFromTitle( $imageTitle ); |
85 | | - if ( !$imageObj->exists() ) { |
| 84 | + if( function_exists( 'wfFindFile' ) ) { |
| 85 | + $imageObj = wfFindFile( $imageTitle ); |
| 86 | + } else { |
| 87 | + // Old MW |
| 88 | + $imageObj = Image::newFromTitle( $imageTitle ); |
| 89 | + } |
| 90 | + if ( !$imageObj || !$imageObj->exists() ) { |
86 | 91 | return self::error( 'imagemap_invalid_image' ); |
87 | 92 | } |
88 | 93 | # Add the linear dimensions to avoid inaccuracy in the scale |