skip Media: links in addition to Special: links
authorAntoine Musso <hashar@users.mediawiki.org>
Thu, 17 Nov 2011 10:10:40 +0000 (10:10 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Thu, 17 Nov 2011 10:10:40 +0000 (10:10 +0000)
That one triggered an exception stack trace when using Media:foo as
a target on Special:WhatLinksHere.

Example:
Special:WhatLinksHere/Media:file.png

That is a rare occurence that "should not happen". I am not sure it is
worth backporting to 1.18 although it impacts live site:

http://en.wikipedia.org/wiki/Special:WhatLinksHere/Media:BSicon_uBS2lf.svg

includes/SkinTemplate.php

index 7f20b66..807921b 100644 (file)
@@ -814,7 +814,7 @@ class SkinTemplate extends Skin {
                wfRunHooks( 'SkinTemplatePreventOtherActiveTabs', array( &$this, &$preventActiveTabs ) );
 
                // Checks if page is some kind of content
-               if( !$title->isSpecialPage() ) {
+               if( $title->canExist() ) {
                        // Gets page objects for the related namespaces
                        $subjectPage = $title->getSubjectPage();
                        $talkPage = $title->getTalkPage();