Use Parser::OT_PREPROCESS class const
authorumherirrender <umherirrender_de.wp@web.de>
Fri, 24 Oct 2014 18:40:19 +0000 (20:40 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Fri, 24 Oct 2014 18:40:19 +0000 (20:40 +0200)
Instead of the global const

Change-Id: Ica9a3fdd0a48bb3c71ebb2b84933149a9f275fac

includes/api/ApiExpandTemplates.php
includes/api/ApiParse.php
includes/api/ApiQueryRevisions.php
includes/specials/SpecialExpandTemplates.php

index 93903b5..6e49d3c 100644 (file)
@@ -75,7 +75,7 @@ class ApiExpandTemplates extends ApiBase {
                                $this->logFeatureUsage( 'action=expandtemplates&generatexml' );
                        }
 
-                       $wgParser->startExternalParse( $title_obj, $options, OT_PREPROCESS );
+                       $wgParser->startExternalParse( $title_obj, $options, Parser::OT_PREPROCESS );
                        $dom = $wgParser->preprocessToDom( $params['text'] );
                        if ( is_callable( array( $dom, 'saveXML' ) ) ) {
                                $xml = $dom->saveXML();
@@ -96,7 +96,7 @@ class ApiExpandTemplates extends ApiBase {
                // if they didn't want any output except (probably) the parse tree,
                // then don't bother actually fully expanding it
                if ( $prop || $params['prop'] === null ) {
-                       $wgParser->startExternalParse( $title_obj, $options, OT_PREPROCESS );
+                       $wgParser->startExternalParse( $title_obj, $options, Parser::OT_PREPROCESS );
                        $frame = $wgParser->getPreprocessor()->newFrame();
                        $wikitext = $wgParser->preprocess( $params['text'], $title_obj, $options, null, $frame );
                        if ( $params['prop'] === null ) {
index d25c87a..007c620 100644 (file)
@@ -376,7 +376,7 @@ class ApiParse extends ApiBase {
                                $this->dieUsage( "generatexml is only supported for wikitext content", "notwikitext" );
                        }
 
-                       $wgParser->startExternalParse( $titleObj, $popts, OT_PREPROCESS );
+                       $wgParser->startExternalParse( $titleObj, $popts, Parser::OT_PREPROCESS );
                        $dom = $wgParser->preprocessToDom( $this->content->getNativeData() );
                        if ( is_callable( array( $dom, 'saveXML' ) ) ) {
                                $xml = $dom->saveXML();
index d547929..27050ce 100644 (file)
@@ -558,7 +558,7 @@ class ApiQueryRevisions extends ApiQueryBase {
                                        $wgParser->startExternalParse(
                                                $title,
                                                ParserOptions::newFromContext( $this->getContext() ),
-                                               OT_PREPROCESS
+                                               Parser::OT_PREPROCESS
                                        );
                                        $dom = $wgParser->preprocessToDom( $t );
                                        if ( is_callable( array( $dom, 'saveXML' ) ) ) {
index f3adeba..aab9c3e 100644 (file)
@@ -77,7 +77,7 @@ class SpecialExpandTemplates extends SpecialPage {
                        $options->setMaxIncludeSize( self::MAX_INCLUDE_SIZE );
 
                        if ( $this->generateXML ) {
-                               $wgParser->startExternalParse( $title, $options, OT_PREPROCESS );
+                               $wgParser->startExternalParse( $title, $options, Parser::OT_PREPROCESS );
                                $dom = $wgParser->preprocessToDom( $input );
 
                                if ( method_exists( $dom, 'saveXML' ) ) {