From: Roan Kattouw Date: Fri, 28 Mar 2008 13:27:44 +0000 (+0000) Subject: (bug 13544) Added prop=revid to action=parse X-Git-Tag: 1.31.0-rc.0~48753 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=99a2c57c5be1c34e8f830ed14f665ae0751783b7;p=lhc%2Fweb%2Fwiklou.git (bug 13544) Added prop=revid to action=parse --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 51aa602f31..1fd5e3b6ce 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -173,6 +173,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 11719) Remove trailing blanks in YAML output. * (bug 13541) Added siprop=specialpagealiases to meta=siteinfo * Added fallback8bitEncoding field to meta=siteinfo&siprop=general output +* (bug 13544) Added prop=revid to action=parse === Languages updated in 1.13 === diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index 011c729062..e4c85996ac 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -46,6 +46,7 @@ class ApiParse extends ApiBase { if(!is_null($page) && (!is_null($text) || $title != "API")) $this->dieUsage("The page parameter cannot be used together with the text and title parameters", 'params'); $prop = array_flip($params['prop']); + $revid = false; global $wgParser, $wgUser; if(!is_null($page)) { @@ -55,6 +56,8 @@ class ApiParse extends ApiBase { // Try the parser cache first $articleObj = new Article($titleObj); + if(isset($prop['revid'])) + $revid = $articleObj->getRevIdFetched(); $pcache =& ParserCache::singleton(); $p_result = $pcache->get($articleObj, $wgUser); if(!$p_result) { @@ -91,6 +94,8 @@ class ApiParse extends ApiBase { $result_array['externallinks'] = array_keys($p_result->getExternalLinks()); if(isset($prop['sections'])) $result_array['sections'] = $p_result->getSections(); + if($revid !== false) + $result_array['revid'] = $revid; $result_mapping = array( 'langlinks' => 'll', @@ -158,7 +163,7 @@ class ApiParse extends ApiBase { 'text' => null, 'page' => null, 'prop' => array( - ApiBase :: PARAM_DFLT => 'text|langlinks|categories|links|templates|images|externallinks|sections', + ApiBase :: PARAM_DFLT => 'text|langlinks|categories|links|templates|images|externallinks|sections|revid', ApiBase :: PARAM_ISMULTI => true, ApiBase :: PARAM_TYPE => array( 'text', @@ -168,7 +173,8 @@ class ApiParse extends ApiBase { 'templates', 'images', 'externallinks', - 'sections' + 'sections', + 'revid' ) ) );