summaryrefslogtreecommitdiff
path: root/includes/api/ApiParse.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2009-06-10 13:00:47 +0200
committerPierre Schmitz <pierre@archlinux.de>2009-06-10 13:00:47 +0200
commit72e90545454c0e014318fa3c81658e035aac58c1 (patch)
tree9212e3f46868989c4d57ae9a5c8a1a80e4dc0702 /includes/api/ApiParse.php
parent565a0ccc371ec1a2a0e9b39487cbac18e6f60e25 (diff)
applying patch to version 1.15.0
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 $';
}
}