From 0afa5cd5a3f8960184649ca929ea4a2cb998eaf8 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Thu, 22 Sep 2011 15:08:32 +0000 Subject: [PATCH] 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 --- includes/Linker.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 ) ) { -- 2.20.1