(bug 11721) API: Use a different title for results than for the help page.
authorDaniel Cannon <amidaniel@users.mediawiki.org>
Wed, 24 Oct 2007 19:34:29 +0000 (19:34 +0000)
committerDaniel Cannon <amidaniel@users.mediawiki.org>
Wed, 24 Oct 2007 19:34:29 +0000 (19:34 +0000)
RELEASE-NOTES
includes/api/ApiFormatBase.php
includes/api/ApiMain.php

index 53d680d..1472c5b 100644 (file)
@@ -140,6 +140,7 @@ Full API documentation is available at http://www.mediawiki.org/wiki/API
 * Add rctype parameter to list=recentchanges that filters by type
 * Add apprtype and apprlevel parameters to filter list=allpages by protection types and levels
 * Add apdir parameter to enable listing all pages from Z to A
+* (bug 11721) Use a different title for results than for the help page.
 
 === Languages updated in 1.12 ===
 
index dc5b744..04de861 100644 (file)
@@ -111,7 +111,11 @@ abstract class ApiFormatBase extends ApiBase {
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
 <head>
-       <title>MediaWiki API</title>
+<? if ($this->mUnescapeAmps) { 
+?>     <title>MediaWiki API</title>
+<? } else {
+?>     <title>MediaWiki API Result</title>
+<? } ?>
 </head>
 <body>
 <?php
index 52ea73d..c1ef461 100644 (file)
@@ -320,7 +320,6 @@ class ApiMain extends ApiBase {
        protected function printResult($isError) {
                $printer = $this->mPrinter;
                $printer->profileIn();
-               $printer->initPrinter($isError);
        
                /* If the help message is requested in the default (xmlfm) format,
                 * tell the printer not to escape ampersands so that our links do
@@ -329,6 +328,8 @@ class ApiMain extends ApiBase {
                $printer->setUnescapeAmps ( $this->mAction == 'help' 
                                && $params['format'] == ApiMain::API_DEFAULT_FORMAT );
 
+               $printer->initPrinter($isError);
+
                $printer->execute();
                $printer->closePrinter();
                $printer->profileOut();