r40496 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40495‎ | r40496 | r40497 >
Date:15:35, 5 September 2008
Author:simetrical
Status:old
Tags:
Comment:
Don't fail fatally when Linker::link() is passed a non-object

This matches old behavior of makeKnownLinkObj() et al., effectively reverting part of r38162. We'd usually like to render the rest of the page even if one link fails. We might want to raise an E_USER_WARNING here, though.
Modified paths:
  • /trunk/phase3/includes/Linker.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Linker.php
@@ -178,7 +178,7 @@
179179 }
180180
181181 if( !$target instanceof Title ) {
182 - throw new MWException( 'Linker::link passed invalid target' );
 182+ return "<!-- ERROR -->$text";
183183 }
184184 $options = (array)$options;
185185

Follow-up revisions

RevisionCommit summaryAuthorDate
r40622Partially fix #15528. Use Linker::link() from r40496 to deal with invalid...hashar22:08, 8 September 2008
r40626(bug 15528) Don't fail fatally on invalid titles...simetrical22:53, 8 September 2008

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r38162Linker.php cleanup:...simetrical00:08, 29 July 2008