From 272843a55d727e4ea736829586080098a83df330 Mon Sep 17 00:00:00 2001 From: Kevin Israel Date: Thu, 30 Apr 2015 13:48:52 -0400 Subject: [PATCH] Move some global statements to top of function These were flagged by mediawiki/tools/code-utils/check-vars.php because they were located inside a switch statement, or inside an if statement and used outside the statement. All other warnings from that script are bogus, mostly because the script has no support for PHP 5.3 namespaces. Change-Id: If93bae4434b5c28845125095f6a22d6788a76efc --- includes/logging/LogFormatter.php | 4 ++-- includes/logging/LogPager.php | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/includes/logging/LogFormatter.php b/includes/logging/LogFormatter.php index 9c2fdd354a..119492be8c 100644 --- a/includes/logging/LogFormatter.php +++ b/includes/logging/LogFormatter.php @@ -193,6 +193,8 @@ class LogFormatter { * @return string Text */ public function getIRCActionText() { + global $wgContLang; + $this->plaintext = true; $this->irctext = true; @@ -338,7 +340,6 @@ class LogFormatter { case 'block': switch ( $entry->getSubtype() ) { case 'block': - global $wgContLang; // Keep compatibility with extensions by checking for // new key (5::duration/6::flags) or old key (0/optional 1) if ( $entry->isLegacy() ) { @@ -358,7 +359,6 @@ class LogFormatter { ->rawParams( $target )->inContentLanguage()->escaped(); break; case 'reblock': - global $wgContLang; $duration = $wgContLang->translateBlockExpiry( $parameters['5::duration'] ); $flags = BlockLogFormatter::formatBlockFlags( $parameters['6::flags'], $wgContLang ); $text = wfMessage( 'reblock-logentry' ) diff --git a/includes/logging/LogPager.php b/includes/logging/LogPager.php index bf489ab9aa..c4ce7b3e9e 100644 --- a/includes/logging/LogPager.php +++ b/includes/logging/LogPager.php @@ -192,7 +192,7 @@ class LogPager extends ReverseChronologicalPager { * @return void */ private function limitTitle( $page, $pattern ) { - global $wgMiserMode; + global $wgMiserMode, $wgUserrightsInterwikiDelimiter; if ( $page instanceof Title ) { $title = $page; @@ -209,7 +209,6 @@ class LogPager extends ReverseChronologicalPager { $doUserRightsLogLike = false; if ( $this->types == array( 'rights' ) ) { - global $wgUserrightsInterwikiDelimiter; $parts = explode( $wgUserrightsInterwikiDelimiter, $title->getDBKey() ); if ( count( $parts ) == 2 ) { list( $name, $database ) = array_map( 'trim', $parts ); -- 2.20.1