Index: trunk/phase3/includes/api/ApiParse.php |
— | — | @@ -46,6 +46,7 @@ |
47 | 47 | if(!is_null($page) && (!is_null($text) || $title != "API")) |
48 | 48 | $this->dieUsage("The page parameter cannot be used together with the text and title parameters", 'params'); |
49 | 49 | $prop = array_flip($params['prop']); |
| 50 | + $revid = false; |
50 | 51 | |
51 | 52 | global $wgParser, $wgUser; |
52 | 53 | if(!is_null($page)) { |
— | — | @@ -55,6 +56,8 @@ |
56 | 57 | |
57 | 58 | // Try the parser cache first |
58 | 59 | $articleObj = new Article($titleObj); |
| 60 | + if(isset($prop['revid'])) |
| 61 | + $revid = $articleObj->getRevIdFetched(); |
59 | 62 | $pcache =& ParserCache::singleton(); |
60 | 63 | $p_result = $pcache->get($articleObj, $wgUser); |
61 | 64 | if(!$p_result) { |
— | — | @@ -91,6 +94,8 @@ |
92 | 95 | $result_array['externallinks'] = array_keys($p_result->getExternalLinks()); |
93 | 96 | if(isset($prop['sections'])) |
94 | 97 | $result_array['sections'] = $p_result->getSections(); |
| 98 | + if($revid !== false) |
| 99 | + $result_array['revid'] = $revid; |
95 | 100 | |
96 | 101 | $result_mapping = array( |
97 | 102 | 'langlinks' => 'll', |
— | — | @@ -158,7 +163,7 @@ |
159 | 164 | 'text' => null, |
160 | 165 | 'page' => null, |
161 | 166 | 'prop' => array( |
162 | | - ApiBase :: PARAM_DFLT => 'text|langlinks|categories|links|templates|images|externallinks|sections', |
| 167 | + ApiBase :: PARAM_DFLT => 'text|langlinks|categories|links|templates|images|externallinks|sections|revid', |
163 | 168 | ApiBase :: PARAM_ISMULTI => true, |
164 | 169 | ApiBase :: PARAM_TYPE => array( |
165 | 170 | 'text', |
— | — | @@ -168,7 +173,8 @@ |
169 | 174 | 'templates', |
170 | 175 | 'images', |
171 | 176 | 'externallinks', |
172 | | - 'sections' |
| 177 | + 'sections', |
| 178 | + 'revid' |
173 | 179 | ) |
174 | 180 | ) |
175 | 181 | ); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -173,6 +173,7 @@ |
174 | 174 | * (bug 11719) Remove trailing blanks in YAML output. |
175 | 175 | * (bug 13541) Added siprop=specialpagealiases to meta=siteinfo |
176 | 176 | * Added fallback8bitEncoding field to meta=siteinfo&siprop=general output |
| 177 | +* (bug 13544) Added prop=revid to action=parse |
177 | 178 | |
178 | 179 | === Languages updated in 1.13 === |
179 | 180 | |