From ffa443c049a049d4f02dc29368b07e590a52553f Mon Sep 17 00:00:00 2001 From: X! Date: Tue, 4 Jan 2011 01:35:01 +0000 Subject: [PATCH] Followup to r79532: Did I really need to implement a parameter? No, I did not. --- includes/api/ApiFormatBase.php | 6 ++++-- tests/phpunit/includes/api/format/ApiFormatTestBase.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php index 5d233e0ed7..91562f24d5 100644 --- a/includes/api/ApiFormatBase.php +++ b/includes/api/ApiFormatBase.php @@ -145,8 +145,10 @@ abstract class ApiFormatBase extends ApiBase { if ( is_null( $mime ) ) { return; // skip any initialization } - - header( "Content-Type: $mime; charset=utf-8" ); + + if( !$this->getMain()->isInternalMode() ) { + header( "Content-Type: $mime; charset=utf-8" ); + } if ( $isHtml ) { ?> diff --git a/tests/phpunit/includes/api/format/ApiFormatTestBase.php b/tests/phpunit/includes/api/format/ApiFormatTestBase.php index 96800c5756..cf60d5eae6 100644 --- a/tests/phpunit/includes/api/format/ApiFormatTestBase.php +++ b/tests/phpunit/includes/api/format/ApiFormatTestBase.php @@ -13,7 +13,7 @@ abstract class ApiFormatTestBase extends ApiTestSetup { $printer = $module->createPrinterByName( $format ); $printer->setUnescapeAmps(false); - $printer->initPrinter(false, true); + $printer->initPrinter(false); ob_start(); $printer->execute(); -- 2.20.1