From c8ce2d264a723cdf4859307a7cb0daab06f606c2 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Sun, 3 Aug 2014 15:59:42 -0700 Subject: [PATCH] SpecialLinkSearch: Use Config instead of globals Change-Id: I387049cc524de0847d0f195e4435d1935c7a047f --- includes/specials/SpecialLinkSearch.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/includes/specials/SpecialLinkSearch.php b/includes/specials/SpecialLinkSearch.php index 10d1957a13..371469bb27 100644 --- a/includes/specials/SpecialLinkSearch.php +++ b/includes/specials/SpecialLinkSearch.php @@ -78,8 +78,6 @@ class LinkSearchPage extends QueryPage { } function execute( $par ) { - global $wgUrlProtocols, $wgMiserMode, $wgScript; - $this->initServices(); $this->setHeaders(); @@ -93,7 +91,7 @@ class LinkSearchPage extends QueryPage { $namespace = $request->getIntorNull( 'namespace', null ); $protocols_list = array(); - foreach ( $wgUrlProtocols as $prot ) { + foreach ( $this->getConfig()->get( 'UrlProtocols' ) as $prot ) { if ( $prot !== '//' ) { $protocols_list[] = $prot; } @@ -122,7 +120,7 @@ class LinkSearchPage extends QueryPage { ); $s = Html::openElement( 'form', - array( 'id' => 'mw-linksearch-form', 'method' => 'get', 'action' => $wgScript ) + array( 'id' => 'mw-linksearch-form', 'method' => 'get', 'action' => wfScript() ) ) . "\n" . Html::hidden( 'title', $this->getPageTitle()->getPrefixedDBkey() ) . "\n" . Html::openElement( 'fieldset' ) . "\n" . @@ -139,7 +137,7 @@ class LinkSearchPage extends QueryPage { ) ) . "\n"; - if ( !$wgMiserMode ) { + if ( !$this->getConfig()->get( 'MiserMode' ) ) { $s .= Html::namespaceSelector( array( 'selected' => $namespace, @@ -210,10 +208,9 @@ class LinkSearchPage extends QueryPage { } function linkParameters() { - global $wgMiserMode; $params = array(); $params['target'] = $this->mProt . $this->mQuery; - if ( $this->mNs !== null && !$wgMiserMode ) { + if ( $this->mNs !== null && !$this->getConfig()->get( 'MiserMode' ) ) { $params['namespace'] = $this->mNs; } @@ -221,7 +218,6 @@ class LinkSearchPage extends QueryPage { } function getQueryInfo() { - global $wgMiserMode; $dbr = wfGetDB( DB_SLAVE ); // strip everything past first wildcard, so that // index-based-only lookup would be done @@ -248,7 +244,7 @@ class LinkSearchPage extends QueryPage { 'options' => array( 'USE INDEX' => $clause ) ); - if ( $this->mNs !== null && !$wgMiserMode ) { + if ( $this->mNs !== null && !$this->getConfig()->get( 'MiserMode' ) ) { $retval['conds']['page_namespace'] = $this->mNs; } -- 2.20.1