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
This commit is contained in:
Kevin Israel 2015-04-30 13:48:52 -04:00 committed by Legoktm
parent 3ae6b8ad5f
commit 272843a55d
2 changed files with 3 additions and 4 deletions

View file

@ -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' )

View file

@ -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 );