From: Kunal Mehta Date: Wed, 15 Aug 2018 03:58:34 +0000 (-0700) Subject: Have TitleParser::parseTitle() default to NS_MAIN to match Title X-Git-Tag: 1.34.0-rc.0~4419^2~5 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22messagerie%22%29%20.%20%22?a=commitdiff_plain;h=f339c908513e4c8e7923cc0366a6ceebcbcc3a16;p=lhc%2Fweb%2Fwiklou.git Have TitleParser::parseTitle() default to NS_MAIN to match Title Matches the default parameters of Title::newFromText(). Change-Id: Id08312d424be9ae7e64688bb21687204ae77c560 --- diff --git a/includes/title/MediaWikiTitleCodec.php b/includes/title/MediaWikiTitleCodec.php index 890a870a2a..a00ef1e966 100644 --- a/includes/title/MediaWikiTitleCodec.php +++ b/includes/title/MediaWikiTitleCodec.php @@ -149,7 +149,7 @@ class MediaWikiTitleCodec implements TitleFormatter, TitleParser { * @throws MalformedTitleException * @return TitleValue */ - public function parseTitle( $text, $defaultNamespace ) { + public function parseTitle( $text, $defaultNamespace = NS_MAIN ) { // NOTE: this is an ugly cludge that allows this class to share the // code for parsing with the old Title class. The parser code should // be refactored to avoid this. diff --git a/includes/title/TitleParser.php b/includes/title/TitleParser.php index de65be8529..ddffed6789 100644 --- a/includes/title/TitleParser.php +++ b/includes/title/TitleParser.php @@ -43,5 +43,5 @@ interface TitleParser { * @throws MalformedTitleException If the text is not a valid representation of a page title. * @return TitleValue */ - public function parseTitle( $text, $defaultNamespace ); + public function parseTitle( $text, $defaultNamespace = NS_MAIN ); }