Index: trunk/phase3/includes/api/ApiQueryRecentChanges.php |
— | — | @@ -108,6 +108,7 @@ |
109 | 109 | * Generates and outputs the result of this query based upon the provided parameters. |
110 | 110 | */ |
111 | 111 | public function execute() { |
| 112 | + global $wgUser; |
112 | 113 | /* Get the parameters of the request. */ |
113 | 114 | $params = $this->extractRequestParams(); |
114 | 115 | |
— | — | @@ -141,7 +142,6 @@ |
142 | 143 | } |
143 | 144 | |
144 | 145 | // Check permissions |
145 | | - global $wgUser; |
146 | 146 | if ( isset( $show['patrolled'] ) || isset( $show['!patrolled'] ) ) { |
147 | 147 | if ( !$wgUser->useRCPatrol() && !$wgUser->useNPPatrol() ) { |
148 | 148 | $this->dieUsage( 'You need the patrol right to request the patrolled flag', 'permissiondenied' ); |
— | — | @@ -197,7 +197,6 @@ |
198 | 198 | /* Set up internal members based upon params. */ |
199 | 199 | $this->initProperties( $prop ); |
200 | 200 | |
201 | | - global $wgUser; |
202 | 201 | if ( $this->fld_patrolled && !$wgUser->useRCPatrol() && !$wgUser->useNPPatrol() ) |
203 | 202 | { |
204 | 203 | $this->dieUsage( 'You need the patrol right to request the patrolled flag', 'permissiondenied' ); |
Index: trunk/phase3/includes/api/ApiQueryDeletedrevs.php |
— | — | @@ -208,7 +208,6 @@ |
209 | 209 | $title = Title::makeTitle( $row->ar_namespace, $row->ar_title ); |
210 | 210 | |
211 | 211 | if ( $fld_parsedcomment ) { |
212 | | - global $wgUser; |
213 | 212 | $rev['parsedcomment'] = $wgUser->getSkin()->formatComment( $row->ar_comment, $title ); |
214 | 213 | } |
215 | 214 | if ( $fld_minor && $row->ar_minor_edit == 1 ) { |
Index: trunk/phase3/includes/api/ApiLogin.php |
— | — | @@ -89,7 +89,6 @@ |
90 | 90 | break; |
91 | 91 | |
92 | 92 | case LoginForm::NEED_TOKEN: |
93 | | - global $wgCookiePrefix; |
94 | 93 | $result['result'] = 'NeedToken'; |
95 | 94 | $result['token'] = $loginForm->getLoginToken(); |
96 | 95 | $result['cookieprefix'] = $wgCookiePrefix; |
Index: trunk/phase3/includes/api/ApiQueryRevisions.php |
— | — | @@ -422,14 +422,13 @@ |
423 | 423 | } |
424 | 424 | |
425 | 425 | $text = null; |
| 426 | + global $wgParser; |
426 | 427 | if ( $this->fld_content || !is_null( $this->difftotext ) ) { |
427 | 428 | $text = $revision->getText(); |
428 | 429 | // Expand templates after getting section content because |
429 | 430 | // template-added sections don't count and Parser::preprocess() |
430 | 431 | // will have less input |
431 | 432 | if ( $this->section !== false ) { |
432 | | - global $wgParser; |
433 | | - |
434 | 433 | $text = $wgParser->getSection( $text, $this->section, false ); |
435 | 434 | if ( $text === false ) { |
436 | 435 | $this->dieUsage( "There is no section {$this->section} in r" . $revision->getId(), 'nosuchsection' ); |
— | — | @@ -438,7 +437,6 @@ |
439 | 438 | } |
440 | 439 | if ( $this->fld_content && !$revision->isDeleted( Revision::DELETED_TEXT ) ) { |
441 | 440 | if ( $this->generateXML ) { |
442 | | - global $wgParser; |
443 | 441 | $wgParser->startExternalParse( $title, new ParserOptions(), OT_PREPROCESS ); |
444 | 442 | $dom = $wgParser->preprocessToDom( $text ); |
445 | 443 | if ( is_callable( array( $dom, 'saveXML' ) ) ) { |
— | — | @@ -450,7 +448,6 @@ |
451 | 449 | |
452 | 450 | } |
453 | 451 | if ( $this->expandTemplates ) { |
454 | | - global $wgParser; |
455 | 452 | $text = $wgParser->preprocess( $text, $title, new ParserOptions() ); |
456 | 453 | } |
457 | 454 | ApiResult::setContent( $vals, $text ); |
Index: trunk/phase3/includes/api/ApiQueryUserContributions.php |
— | — | @@ -213,7 +213,6 @@ |
214 | 214 | if ( isset( $show['patrolled'] ) || isset( $show['!patrolled'] ) || |
215 | 215 | $this->fld_patrolled ) |
216 | 216 | { |
217 | | - global $wgUser; |
218 | 217 | if ( !$wgUser->useRCPatrol() && !$wgUser->useNPPatrol() ) { |
219 | 218 | $this->dieUsage( 'You need the patrol right to request the patrolled flag', 'permissiondenied' ); |
220 | 219 | } |