r33921 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r33920‎ | r33921 | r33922 >
Date:18:24, 26 April 2008
Author:brion
Status:old
Tags:
Comment:
suppress deprecated warning by using wfFindFile() if available instead of Image::newFromTitle
Modified paths:
  • /trunk/extensions/ImageMap/ImageMap_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ImageMap/ImageMap_body.php
@@ -80,8 +80,13 @@
8181 $thumbWidth = $imageNode->getAttribute('width');
8282 $thumbHeight = $imageNode->getAttribute('height');
8383
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() ) {
8691 return self::error( 'imagemap_invalid_image' );
8792 }
8893 # Add the linear dimensions to avoid inaccuracy in the scale

Status & tagging log