From 958a998611ee5a4230a316be987a26947824195f Mon Sep 17 00:00:00 2001 From: Platonides Date: Sun, 25 Jul 2010 19:45:52 +0000 Subject: [PATCH] Remove double globals. --- includes/api/ApiLogin.php | 1 - includes/api/ApiQueryDeletedrevs.php | 1 - includes/api/ApiQueryRecentChanges.php | 3 +-- includes/api/ApiQueryRevisions.php | 5 +---- includes/api/ApiQueryUserContributions.php | 1 - 5 files changed, 2 insertions(+), 9 deletions(-) diff --git a/includes/api/ApiLogin.php b/includes/api/ApiLogin.php index c45ff213aa..c83b8c3161 100644 --- a/includes/api/ApiLogin.php +++ b/includes/api/ApiLogin.php @@ -89,7 +89,6 @@ class ApiLogin extends ApiBase { break; case LoginForm::NEED_TOKEN: - global $wgCookiePrefix; $result['result'] = 'NeedToken'; $result['token'] = $loginForm->getLoginToken(); $result['cookieprefix'] = $wgCookiePrefix; diff --git a/includes/api/ApiQueryDeletedrevs.php b/includes/api/ApiQueryDeletedrevs.php index e5635daf8b..d7fb5304fd 100644 --- a/includes/api/ApiQueryDeletedrevs.php +++ b/includes/api/ApiQueryDeletedrevs.php @@ -208,7 +208,6 @@ class ApiQueryDeletedrevs extends ApiQueryBase { $title = Title::makeTitle( $row->ar_namespace, $row->ar_title ); if ( $fld_parsedcomment ) { - global $wgUser; $rev['parsedcomment'] = $wgUser->getSkin()->formatComment( $row->ar_comment, $title ); } if ( $fld_minor && $row->ar_minor_edit == 1 ) { diff --git a/includes/api/ApiQueryRecentChanges.php b/includes/api/ApiQueryRecentChanges.php index 609e86df98..f2c367719a 100644 --- a/includes/api/ApiQueryRecentChanges.php +++ b/includes/api/ApiQueryRecentChanges.php @@ -108,6 +108,7 @@ class ApiQueryRecentChanges extends ApiQueryBase { * Generates and outputs the result of this query based upon the provided parameters. */ public function execute() { + global $wgUser; /* Get the parameters of the request. */ $params = $this->extractRequestParams(); @@ -141,7 +142,6 @@ class ApiQueryRecentChanges extends ApiQueryBase { } // Check permissions - global $wgUser; if ( isset( $show['patrolled'] ) || isset( $show['!patrolled'] ) ) { if ( !$wgUser->useRCPatrol() && !$wgUser->useNPPatrol() ) { $this->dieUsage( 'You need the patrol right to request the patrolled flag', 'permissiondenied' ); @@ -197,7 +197,6 @@ class ApiQueryRecentChanges extends ApiQueryBase { /* Set up internal members based upon params. */ $this->initProperties( $prop ); - global $wgUser; if ( $this->fld_patrolled && !$wgUser->useRCPatrol() && !$wgUser->useNPPatrol() ) { $this->dieUsage( 'You need the patrol right to request the patrolled flag', 'permissiondenied' ); diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index a90a73bb95..aefc647c9c 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -422,14 +422,13 @@ class ApiQueryRevisions extends ApiQueryBase { } $text = null; + global $wgParser; if ( $this->fld_content || !is_null( $this->difftotext ) ) { $text = $revision->getText(); // Expand templates after getting section content because // template-added sections don't count and Parser::preprocess() // will have less input if ( $this->section !== false ) { - global $wgParser; - $text = $wgParser->getSection( $text, $this->section, false ); if ( $text === false ) { $this->dieUsage( "There is no section {$this->section} in r" . $revision->getId(), 'nosuchsection' ); @@ -438,7 +437,6 @@ class ApiQueryRevisions extends ApiQueryBase { } if ( $this->fld_content && !$revision->isDeleted( Revision::DELETED_TEXT ) ) { if ( $this->generateXML ) { - global $wgParser; $wgParser->startExternalParse( $title, new ParserOptions(), OT_PREPROCESS ); $dom = $wgParser->preprocessToDom( $text ); if ( is_callable( array( $dom, 'saveXML' ) ) ) { @@ -450,7 +448,6 @@ class ApiQueryRevisions extends ApiQueryBase { } if ( $this->expandTemplates ) { - global $wgParser; $text = $wgParser->preprocess( $text, $title, new ParserOptions() ); } ApiResult::setContent( $vals, $text ); diff --git a/includes/api/ApiQueryUserContributions.php b/includes/api/ApiQueryUserContributions.php index 51b3914319..09eab1dd1d 100644 --- a/includes/api/ApiQueryUserContributions.php +++ b/includes/api/ApiQueryUserContributions.php @@ -213,7 +213,6 @@ class ApiQueryContributions extends ApiQueryBase { if ( isset( $show['patrolled'] ) || isset( $show['!patrolled'] ) || $this->fld_patrolled ) { - global $wgUser; if ( !$wgUser->useRCPatrol() && !$wgUser->useNPPatrol() ) { $this->dieUsage( 'You need the patrol right to request the patrolled flag', 'permissiondenied' ); } -- 2.20.1