{{#special:}} should always return a usable title in NS_SPECIAL,
even when given an unknown special page title. Currently, it returns
"No such special page" text for such unknown names, which is
surprising.
Bug: 47449
Change-Id: I7f184956ec9d56c849f201f1230736fcedd0fadf
$title = SpecialPage::getTitleFor( $page, $subpage );
return $title->getPrefixedText();
} else {
- return wfMessage( 'nosuchspecialpage' )->inContentLanguage()->text();
+ // unknown special page, just use the given text as its title, if at all possible
+ $title = Title::makeTitleSafe( NS_SPECIAL, $text );
+ return $title ? $title->getPrefixedText() : self::special( $parser, 'Badtitle' );
}
}
!! options
msg
!! input
-{{#special:foobarnonexistent}}
+{{#special:foobar nonexistent}}
!! result
-No such special page
+Special:Foobar nonexistent
!! end
!! test
!! options
msg
!! input
-{{#speciale:foobarnonexistent}}
+{{#speciale:foobar nonexistent}}
!! result
-No_such_special_page
+Special:Foobar_nonexistent
!! end
###
</p>
!! end
+!!test
+Special parser function
+!! input
+{{#special:RandomPage}}
+{{#special:BaDtItLe}}
+{{#special:Foobar}}
+!! result
+<p>Special:Random
+Special:Badtitle
+Special:Foobar
+</p>
+!! end
+
!!test
Bug 34939 - Case insensitive link parsing ([HttP://])
!! input