From: Sam Reed Date: Thu, 22 Sep 2011 15:08:32 +0000 (+0000) Subject: Guard against X-Git-Tag: 1.31.0-rc.0~27476 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=0afa5cd5a3f8960184649ca929ea4a2cb998eaf8;p=lhc%2Fweb%2Fwiklou.git Guard against PHP fatal error in /home/wikipedia/common/php-1.18/includes/Linker.php line 831: Argument 1 passed to Linker::makeMediaLinkObj() must be an instance of Title, null given, called in /home/wikipedia/common/php-1.18/includes/Linker.php on line 1221 and defined --- diff --git a/includes/Linker.php b/includes/Linker.php index 84ede27e7a..6d264c37f1 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1234,7 +1234,9 @@ class Linker { # Media link; trail not supported. $linkRegexp = '/\[\[(.*?)\]\]/'; $title = Title::makeTitleSafe( NS_FILE, $submatch[1] ); - $thelink = self::makeMediaLinkObj( $title, $text ); + if ( $title ) { + $thelink = self::makeMediaLinkObj( $title, $text ); + } } else { # Other kind of link if ( preg_match( $wgContLang->linkTrail(), $match[4], $submatch ) ) {