Merge "fixed php doc in ApiBase"
[lhc/web/wiklou.git] / includes / api / ApiParse.php
index e86c91c..09b7a88 100644 (file)
@@ -36,10 +36,6 @@ class ApiParse extends ApiBase {
        /** @var Content $pstContent */
        private $pstContent = null;
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        public function execute() {
                // The data is hot but user-dependent, like page views, so we set vary cookies
                $this->getMain()->setCacheMode( 'anon-public-user-private' );
@@ -72,7 +68,7 @@ class ApiParse extends ApiBase {
                // TODO: Does this still need $wgTitle?
                global $wgParser, $wgTitle;
 
-               // Currently unnecessary, code to act as a safeguard against any change in current behaviour of uselang
+               // Currently unnecessary, code to act as a safeguard against any change in current behavior of uselang
                $oldLang = null;
                if ( isset( $params['uselang'] ) && $params['uselang'] != $this->getContext()->getLanguage()->getCode() ) {
                        $oldLang = $this->getContext()->getLanguage(); // Backup language
@@ -105,7 +101,7 @@ class ApiParse extends ApiBase {
                                if ( $rev->isCurrent() ) {
                                        // May get from/save to parser cache
                                        $p_result = $this->getParsedContent( $pageObj, $popts,
-                                               $pageid, isset( $prop['wikitext'] ) ) ;
+                                               $pageid, isset( $prop['wikitext'] ) );
                                } else { // This is an old revision, so get the text differently
                                        $this->content = $rev->getContent( Revision::FOR_THIS_USER, $this->getUser() );
 
@@ -161,11 +157,11 @@ class ApiParse extends ApiBase {
 
                                // Potentially cached
                                $p_result = $this->getParsedContent( $pageObj, $popts, $pageid,
-                                       isset( $prop['wikitext'] ) ) ;
+                                       isset( $prop['wikitext'] ) );
                        }
                } else { // Not $oldid, $pageid, $page. Hence based on $text
                        $titleObj = Title::newFromText( $title );
-                       if ( !$titleObj ) {
+                       if ( !$titleObj || $titleObj->isExternal() ) {
                                $this->dieUsageMsg( array( 'invalidtitle', $title ) );
                        }
                        if ( !$titleObj->canExist() ) {