From 932fc939aa5c8d8918fba9c4ffe739af36129a62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 18 Oct 2012 10:17:36 +0200 Subject: [PATCH 1/2] Do not emit headers in testsuite --- libraries/common.lib.php | 6 ++++-- libraries/error.inc.php | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/libraries/common.lib.php b/libraries/common.lib.php index f8f8ae649c..73beaf6e24 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -3256,8 +3256,10 @@ function PMA_ajaxResponse($message, $success = true, $extra_data = array()) // At this point, other headers might have been sent; // even if $GLOBALS['is_header_sent'] is true, // we have to send these additional headers. - header('Cache-Control: no-cache'); - header("Content-Type: application/json"); + if (!defined('TESTSUITE')) { + header('Cache-Control: no-cache'); + header("Content-Type: application/json"); + } echo json_encode($response); diff --git a/libraries/error.inc.php b/libraries/error.inc.php index 316639addb..527d552153 100644 --- a/libraries/error.inc.php +++ b/libraries/error.inc.php @@ -10,7 +10,9 @@ if (! defined('PHPMYADMIN')) { exit; } -header('Content-Type: text/html; charset=utf-8'); +if (!defined('TESTSUITE')) { + header('Content-Type: text/html; charset=utf-8'); +} ?> From 093b814af622639d6633a3723439cbde3c01b814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 18 Oct 2012 10:18:58 +0200 Subject: [PATCH 2/2] This is static function --- libraries/Advisor.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/Advisor.class.php b/libraries/Advisor.class.php index 0c031405ba..125ec64852 100644 --- a/libraries/Advisor.class.php +++ b/libraries/Advisor.class.php @@ -110,7 +110,7 @@ class Advisor * * @return string */ - function escapePercent($str) + static function escapePercent($str) { return preg_replace('/%( |,|\.|$|\(|\)|<|>)/', '%%\1', $str); }