Fix CodeSniffer and warnings in includes/db
[lhc/web/wiklou.git] / includes / api / ApiExpandTemplates.php
index 826171b..28ed5e4 100644 (file)
@@ -42,7 +42,7 @@ class ApiExpandTemplates extends ApiBase {
 
                // Create title for parser
                $title_obj = Title::newFromText( $params['title'] );
-               if ( !$title_obj ) {
+               if ( !$title_obj || $title_obj->isExternal() ) {
                        $this->dieUsageMsg( array( 'invalidtitle', $params['title'] ) );
                }
 
@@ -65,14 +65,14 @@ class ApiExpandTemplates extends ApiBase {
                                $xml = $dom->__toString();
                        }
                        $xml_result = array();
-                       $result->setContent( $xml_result, $xml );
+                       ApiResult::setContent( $xml_result, $xml );
                        $result->addValue( null, 'parsetree', $xml_result );
                }
                $retval = $wgParser->preprocess( $params['text'], $title_obj, $options );
 
                // Return result
                $retval_array = array();
-               $result->setContent( $retval_array, $retval );
+               ApiResult::setContent( $retval_array, $retval );
                $result->addValue( null, $this->getModuleName(), $retval_array );
        }
 
@@ -108,7 +108,7 @@ class ApiExpandTemplates extends ApiBase {
        }
 
        public function getDescription() {
-               return 'Expands all templates in wikitext';
+               return 'Expands all templates in wikitext.';
        }
 
        public function getPossibleErrors() {