From: Tim Starling Date: Mon, 19 Sep 2005 06:08:41 +0000 (+0000) Subject: Tolerate invalid shared title X-Git-Tag: 1.6.0~1613 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=82fbe665cac85064a162073ee5a4f227932f61b7;p=lhc%2Fweb%2Fwiklou.git Tolerate invalid shared title --- diff --git a/includes/Image.php b/includes/Image.php index 66440840f4..a8ff72709a 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -61,7 +61,11 @@ class Image */ function newFromName( $name ) { $title = Title::makeTitleSafe( NS_IMAGE, $name ); - return new Image( $title ); + if ( is_object( $title ) ) { + return new Image( $title ); + } else { + return NULL; + } } /** @@ -224,7 +228,7 @@ class Image # capitalize the first letter of the filename before # looking it up in the shared repository. $sharedImage = Image::newFromName( $wgLang->ucfirst($this->name) ); - $this->fileExists = file_exists( $sharedImage->getFullPath(true) ); + $this->fileExists = $sharedImage && file_exists( $sharedImage->getFullPath(true) ); if ( $this->fileExists ) { $this->name = $sharedImage->name; $this->imagePath = $this->getFullPath(true); @@ -585,7 +589,10 @@ class Image global $wgSVGConverters, $wgSVGConverter; if ($wgSVGConverter && isset( $wgSVGConverters[$wgSVGConverter])) { + wfDebug( "Image::canRender: SVG is ready!\n" ); return true; + } else { + wfDebug( "Image::canRender: SVG renderer missing\n" ); } }