summaryrefslogtreecommitdiff
path: root/includes/api/ApiParse.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/api/ApiParse.php')
-rw-r--r--includes/api/ApiParse.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php
index e221fb1d..8f4b70bf 100644
--- a/includes/api/ApiParse.php
+++ b/includes/api/ApiParse.php
@@ -105,7 +105,7 @@ class ApiParse extends ApiBase {
$p_result = $wgParser->parse($articleObj->getContent(), $titleObj, $popts);
global $wgUseParserCache;
if($wgUseParserCache)
- $pcache->save($p_result, $articleObj, $wgUser);
+ $pcache->save($p_result, $articleObj, $popts);
}
}
}
@@ -151,8 +151,12 @@ class ApiParse extends ApiBase {
$result_array['externallinks'] = array_keys($p_result->getExternalLinks());
if(isset($prop['sections']))
$result_array['sections'] = $p_result->getSections();
+ if(isset($prop['displaytitle']))
+ $result_array['displaytitle'] = $p_result->getDisplayTitle() ?
+ $p_result->getDisplayTitle() :
+ $titleObj->getPrefixedText();
if(!is_null($oldid))
- $result_array['revid'] = $oldid;
+ $result_array['revid'] = intval($oldid);
$result_mapping = array(
'redirects' => 'r',
@@ -223,7 +227,7 @@ class ApiParse extends ApiBase {
'redirects' => false,
'oldid' => null,
'prop' => array(
- ApiBase :: PARAM_DFLT => 'text|langlinks|categories|links|templates|images|externallinks|sections|revid',
+ ApiBase :: PARAM_DFLT => 'text|langlinks|categories|links|templates|images|externallinks|sections|revid|displaytitle',
ApiBase :: PARAM_ISMULTI => true,
ApiBase :: PARAM_TYPE => array(
'text',
@@ -234,7 +238,8 @@ class ApiParse extends ApiBase {
'images',
'externallinks',
'sections',
- 'revid'
+ 'revid',
+ 'displaytitle',
)
),
'pst' => false,
@@ -272,6 +277,6 @@ class ApiParse extends ApiBase {
}
public function getVersion() {
- return __CLASS__ . ': $Id: ApiParse.php 44858 2008-12-20 20:00:07Z catrope $';
+ return __CLASS__ . ': $Id: ApiParse.php 48544 2009-03-18 23:27:48Z aboostani $';
}
}