Don't use getParameter() inside substituteResultWithError(), since it will try to...
authorTim Starling <tstarling@users.mediawiki.org>
Fri, 14 Nov 2008 00:30:34 +0000 (00:30 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Fri, 14 Nov 2008 00:30:34 +0000 (00:30 +0000)
includes/api/ApiFormatBase.php
includes/api/ApiMain.php

index 834588a..0c832aa 100644 (file)
@@ -69,6 +69,13 @@ abstract class ApiFormatBase extends ApiBase {
                return false;
        }
 
+       /**
+        * Get the internal format name
+        */
+       public function getFormat() {
+               return $this->mFormat;
+       }
+
        /**
         * Specify whether or not ampersands should be escaped to '&amp;' when rendering. This
         * should only be set to true for the help message when rendered in the default (xmlfm)
index 35c1426..e94f173 100644 (file)
@@ -445,7 +445,7 @@ class ApiMain extends ApiBase {
                 * tell the printer not to escape ampersands so that our links do
                 * not break. */
                $printer->setUnescapeAmps ( ( $this->mAction == 'help' || $isError )
-                               && $this->getParameter('format') == ApiMain::API_DEFAULT_FORMAT );
+                               && $printer->getFormat() == 'XML' && $printer->getIsHtml() );
 
                $printer->initPrinter($isError);