From dda591e9ed74f61d0e2c8c8f8cde0d68325f7a17 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Thu, 19 Feb 2015 10:07:38 -0800 Subject: [PATCH] SpecialLinkSearch: clean up munged query variable handling - Drop m prefix, it's silly - Give it a default value so it doesn't complain about undefined variables Change-Id: I378ffe304a5b29d4f35821c1f867d3a26caf5223 --- includes/specials/SpecialLinkSearch.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/includes/specials/SpecialLinkSearch.php b/includes/specials/SpecialLinkSearch.php index f6cb84d28d..20aac18fc1 100644 --- a/includes/specials/SpecialLinkSearch.php +++ b/includes/specials/SpecialLinkSearch.php @@ -27,6 +27,8 @@ * @ingroup SpecialPage */ class LinkSearchPage extends QueryPage { + /** @var array|bool */ + private $mungedQuery = false; /** * @var PageLinkRenderer @@ -162,7 +164,7 @@ class LinkSearchPage extends QueryPage { 'namespace' => $namespace, 'protocol' => $protocol ) ); parent::execute( $par ); - if ( $this->mMungedQuery === false ) { + if ( $this->mungedQuery === false ) { $out->addWikiMsg( 'linksearch-error' ); } } @@ -221,13 +223,13 @@ class LinkSearchPage extends QueryPage { $dbr = wfGetDB( DB_SLAVE ); // strip everything past first wildcard, so that // index-based-only lookup would be done - list( $this->mMungedQuery, $clause ) = self::mungeQuery( $this->mQuery, $this->mProt ); - if ( $this->mMungedQuery === false ) { + list( $this->mungedQuery, $clause ) = self::mungeQuery( $this->mQuery, $this->mProt ); + if ( $this->mungedQuery === false ) { // Invalid query; return no results return array( 'tables' => 'page', 'fields' => 'page_id', 'conds' => '0=1' ); } - $stripped = LinkFilter::keepOneWildcard( $this->mMungedQuery ); + $stripped = LinkFilter::keepOneWildcard( $this->mungedQuery ); $like = $dbr->buildLike( $stripped ); $retval = array( 'tables' => array( 'page', 'externallinks' ), -- 2.20.1