From 96e15c9bd2753b3c5b7dc664a7f887d9afd4bbad Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Thu, 26 May 2016 15:00:49 -0700 Subject: [PATCH] Parser: Make makeKnownLinkHolder() protected, and remove $query handling Extensions shouldn't be calling this, just the Parser, so make it protected. And since the only caller passes an empty array for $query, we can just remove it entirely. Change-Id: I3adbcaabbb40870eb3df1495c3c2743ff21f0c64 --- includes/parser/Parser.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 8f55f01eaf..17098f7cd3 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -2354,7 +2354,7 @@ class Parser { # batch file existence checks for NS_FILE and NS_MEDIA if ( $iw == '' && $nt->isAlwaysKnown() ) { $this->mOutput->addLink( $nt ); - $s .= $this->makeKnownLinkHolder( $nt, $text, [], $trail, $prefix ); + $s .= $this->makeKnownLinkHolder( $nt, $text, $trail, $prefix ); } else { # Links will be added to the output link list after checking $s .= $holders->makeHolder( $nt, $text, [], $trail, $prefix ); @@ -2372,23 +2372,19 @@ class Parser { * * @param Title $nt * @param string $text - * @param array|string $query * @param string $trail * @param string $prefix * @return string HTML-wikitext mix oh yuck */ - public function makeKnownLinkHolder( $nt, $text = '', $query = [], $trail = '', $prefix = '' ) { + protected function makeKnownLinkHolder( $nt, $text = '', $trail = '', $prefix = '' ) { list( $inside, $trail ) = Linker::splitTrail( $trail ); - if ( is_string( $query ) ) { - $query = wfCgiToArray( $query ); - } if ( $text == '' ) { $text = htmlspecialchars( $nt->getPrefixedText() ); } $link = $this->getLinkRenderer()->makeKnownLink( - $nt, new HtmlArmor( "$prefix$text$inside" ), [], $query + $nt, new HtmlArmor( "$prefix$text$inside" ) ); return $this->armorLinks( $link ) . $trail; -- 2.20.1