Parser: Make makeKnownLinkHolder() protected, and remove $query handling
authorKunal Mehta <legoktm@member.fsf.org>
Thu, 26 May 2016 22:00:49 +0000 (15:00 -0700)
committerKunal Mehta <legoktm@member.fsf.org>
Thu, 26 May 2016 22:00:49 +0000 (15:00 -0700)
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

index 8f55f01..17098f7 100644 (file)
@@ -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;