break;
case LoginForm::NEED_TOKEN:
- global $wgCookiePrefix;
$result['result'] = 'NeedToken';
$result['token'] = $loginForm->getLoginToken();
$result['cookieprefix'] = $wgCookiePrefix;
$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 ) {
* 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();
}
// 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' );
/* 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' );
}
$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' );
}
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' ) ) ) {
}
if ( $this->expandTemplates ) {
- global $wgParser;
$text = $wgParser->preprocess( $text, $title, new ParserOptions() );
}
ApiResult::setContent( $vals, $text );
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' );
}