* (bug 18943) Handle invalid titles gracefully at Special:Mostlinked
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Wed, 27 May 2009 19:07:27 +0000 (19:07 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Wed, 27 May 2009 19:07:27 +0000 (19:07 +0000)
RELEASE-NOTES
includes/specials/SpecialMostlinked.php

index a3ac466..95d7632 100644 (file)
@@ -162,6 +162,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   and user can upload
 * Don't say "You need to log in to upload/move", because it's possible that
   uploading/moving is disabled for registered users as well (e.g. only sysops)
+* (bug 18943) Handle invalid titles gracefully at Special:Mostlinked
 
 == API changes in 1.16 ==
 
index e63e250..cbe5e65 100644 (file)
@@ -75,6 +75,9 @@ class MostlinkedPage extends QueryPage {
        function formatResult( $skin, $result ) {
                global $wgLang;
                $title = Title::makeTitleSafe( $result->namespace, $result->title );
+               if ( !$title ) {
+                       return '<!-- ' . htmlspecialchars( "Invalid title: [[$title]]" ) . ' -->';
+               }
                $link = $skin->link( $title );
                $wlh = $this->makeWlhLink( $title,
                        wfMsgExt( 'nlinks', array( 'parsemag', 'escape'),