r97817 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97816‎ | r97817 | r97818 >
Date:15:08, 22 September 2011
Author:reedy
Status:ok
Tags:
Comment:
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
Modified paths:
  • /trunk/phase3/includes/Linker.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Linker.php
@@ -1234,7 +1234,9 @@
12351235 # Media link; trail not supported.
12361236 $linkRegexp = '/\[\[(.*?)\]\]/';
12371237 $title = Title::makeTitleSafe( NS_FILE, $submatch[1] );
1238 - $thelink = self::makeMediaLinkObj( $title, $text );
 1238+ if ( $title ) {
 1239+ $thelink = self::makeMediaLinkObj( $title, $text );
 1240+ }
12391241 } else {
12401242 # Other kind of link
12411243 if ( preg_match( $wgContLang->linkTrail(), $match[4], $submatch ) ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r978181.18wmf1 MFT r97817reedy15:09, 22 September 2011
r98754MFT r93431, r94761, r97762, r97772, r97774, r97777, r97817reedy13:10, 3 October 2011

Status & tagging log