]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - includes/api/ApiParse.php
MediaWiki 1.15.4-scripts
[autoinstallsdev/mediawiki.git] / includes / api / ApiParse.php
index e221fb1d0999435916e9d635a1ed914c8572ab9f..8f4b70bf1a69ee8f9596d2c432bfbee082705835 100644 (file)
@@ -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 $';
        }
 }