summaryrefslogtreecommitdiff
path: root/includes/api/ApiExpandTemplates.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/api/ApiExpandTemplates.php')
-rw-r--r--includes/api/ApiExpandTemplates.php17
1 files changed, 8 insertions, 9 deletions
diff --git a/includes/api/ApiExpandTemplates.php b/includes/api/ApiExpandTemplates.php
index 397aece3..f4e6212a 100644
--- a/includes/api/ApiExpandTemplates.php
+++ b/includes/api/ApiExpandTemplates.php
@@ -43,23 +43,22 @@ class ApiExpandTemplates extends ApiBase {
public function execute() {
// Get parameters
- extract( $this->extractRequestParams() );
- $retval = '';
+ $params = $this->extractRequestParams();
//Create title for parser
- $title_obj = Title :: newFromText( $title );
+ $title_obj = Title :: newFromText( $params['title'] );
if(!$title_obj)
- $title_obj = Title :: newFromText( "API" ); // Default title is "API". For example, ExpandTemplates uses "ExpendTemplates" for it
+ $title_obj = Title :: newFromText( "API" ); // default
$result = $this->getResult();
// Parse text
global $wgParser;
$options = new ParserOptions();
- if ( $generatexml )
+ if ( $params['generatexml'] )
{
$wgParser->startExternalParse( $title_obj, $options, OT_PREPROCESS );
- $dom = $wgParser->preprocessToDom( $text );
+ $dom = $wgParser->preprocessToDom( $params['text'] );
if ( is_callable( array( $dom, 'saveXML' ) ) ) {
$xml = $dom->saveXML();
} else {
@@ -67,9 +66,9 @@ class ApiExpandTemplates extends ApiBase {
}
$xml_result = array();
$result->setContent( $xml_result, $xml );
- $result->addValue( null, 'parsetree', $xml_result);
+ $result->addValue( null, 'parsetree', $xml_result);
}
- $retval = $wgParser->preprocess( $text, $title_obj, $options );
+ $retval = $wgParser->preprocess( $params['text'], $title_obj, $options );
// Return result
$retval_array = array();
@@ -106,6 +105,6 @@ class ApiExpandTemplates extends ApiBase {
}
public function getVersion() {
- return __CLASS__ . ': $Id: ApiExpandTemplates.php 35098 2008-05-20 17:13:28Z ialex $';
+ return __CLASS__ . ': $Id: ApiExpandTemplates.php 44719 2008-12-17 16:34:01Z catrope $';
}
}