From: Florian Date: Sat, 8 Aug 2015 09:56:46 +0000 (+0200) Subject: Use Config instead of globals X-Git-Tag: 1.31.0-rc.0~10482^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/%7B%7B%20url_for%28%27admin_users%27%29%20%7D%7D?a=commitdiff_plain;h=7584c40499ad8697c455b73fd05859fc498fd151;p=lhc%2Fweb%2Fwiklou.git Use Config instead of globals Follow up: I7ed79942c242b1957d46bdcad59985f37466fb83 Change-Id: Iff666a8ecc1f5c5a3fa1a34601fb74206a66b578 --- diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index e9c4042e51..629f88aa61 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -408,8 +408,6 @@ class SpecialSearch extends SpecialPage { * @return bool */ protected function shouldRunSuggestedQuery( SearchResultSet $textMatches ) { - global $wgSearchRunSuggestedQueryPercent; - if ( !$this->runSuggestion || !$textMatches->hasSuggestion() || $textMatches->numRows() > 0 || @@ -421,7 +419,7 @@ class SpecialSearch extends SpecialPage { // Generate a random number between 0 and 1. If the // number is less than the desired percentages run it. $rand = rand( 0, getrandmax() ) / getrandmax(); - return $wgSearchRunSuggestedQueryPercent > $rand; + return $this->getConfig()->get( 'SearchRunSuggestedQueryPercent' ) > $rand; } /**