Remove double globals.
authorPlatonides <platonides@users.mediawiki.org>
Sun, 25 Jul 2010 19:45:52 +0000 (19:45 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Sun, 25 Jul 2010 19:45:52 +0000 (19:45 +0000)
includes/api/ApiLogin.php
includes/api/ApiQueryDeletedrevs.php
includes/api/ApiQueryRecentChanges.php
includes/api/ApiQueryRevisions.php
includes/api/ApiQueryUserContributions.php

index c45ff21..c83b8c3 100644 (file)
@@ -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;
index e5635da..d7fb530 100644 (file)
@@ -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 ) {
index 609e86d..f2c3677 100644 (file)
@@ -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' );
index a90a73b..aefc647 100644 (file)
@@ -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 );
index 51b3914..09eab1d 100644 (file)
@@ -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' );
                        }