From b9b85843572bf283f48285001e276ba7e61b63f6 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 22 Feb 2009 13:37:51 +0100 Subject: updated to MediaWiki 1.14.0 --- includes/api/ApiExpandTemplates.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'includes/api/ApiExpandTemplates.php') 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 $'; } } -- cgit v1.2.3-54-g00ecf