prevent crashing on [[{{FNORD}}]]. Doesn't return something beautiful, though.
authorJens Frank <jeluf@users.mediawiki.org>
Sun, 15 Aug 2004 20:20:41 +0000 (20:20 +0000)
committerJens Frank <jeluf@users.mediawiki.org>
Sun, 15 Aug 2004 20:20:41 +0000 (20:20 +0000)
includes/OutputPage.php
includes/Skin.php

index 54db1f4..e962f04 100644 (file)
@@ -807,6 +807,12 @@ class OutputPage {
                                # Make title object
                                $dbk = $dbkeys[$key];
                                $title = $titles[$key] = Title::makeTitle( $val, $dbk );
+
+                               # Skip invalid entries.
+                               # Result will be ugly, but prevents crash.
+                               if ( is_null( $title ) ) {
+                                       continue;
+                               }
                                $pdbk = $pdbks[$key] = $title->getPrefixedDBkey();
 
                                # Check if it's in the link cache already
index bfda48b..dc69734 100644 (file)
@@ -1580,6 +1580,10 @@ class Skin {
        {
                global $wgOut, $wgUser;
 
+               # Fail gracefully
+               if ( ! isset($nt) )
+                       return "<!-- ERROR -->{$prefix}{$text}{$trail}";
+
                $fname = 'Skin::makeBrokenLinkObj';
                wfProfileIn( $fname );