Don't fail fatally when Linker::link() is passed a non-object
authorAryeh Gregor <simetrical@users.mediawiki.org>
Fri, 5 Sep 2008 15:35:16 +0000 (15:35 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Fri, 5 Sep 2008 15:35:16 +0000 (15:35 +0000)
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.

includes/Linker.php

index cc02241..aa21f90 100644 (file)
@@ -178,7 +178,7 @@ class Linker {
                }
 
                if( !$target instanceof Title ) {
-                       throw new MWException( 'Linker::link passed invalid target' );
+                       return "<!-- ERROR -->$text";
                }
                $options = (array)$options;