Avoid fatal error on invalid title
authorTim Starling <tstarling@users.mediawiki.org>
Sat, 17 Jun 2006 08:55:44 +0000 (08:55 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sat, 17 Jun 2006 08:55:44 +0000 (08:55 +0000)
includes/Parser.php

index ada2708..caae1d2 100644 (file)
@@ -2898,13 +2898,14 @@ class Parser
                        }
                        $title = Title::newFromText( $part1, $ns );
 
-                       $checkVariantLink = sizeof($wgContLang->getVariants())>1;
-                       # Check for language variants if the template is not found
-                       if($checkVariantLink && $title->getArticleID() == 0){
-                               $wgContLang->findVariantLink($part1, $title);
-                       }
 
                        if ( !is_null( $title ) ) {
+                               $checkVariantLink = sizeof($wgContLang->getVariants())>1;
+                               # Check for language variants if the template is not found
+                               if($checkVariantLink && $title->getArticleID() == 0){
+                                       $wgContLang->findVariantLink($part1, $title);
+                               }
+
                                if ( !$title->isExternal() ) {
                                        # Check for excessive inclusion
                                        $dbk = $title->getPrefixedDBkey();