From 439a24c6a241699225bb88bd8228d2a2fcf3dc59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 17 Feb 2011 10:06:41 +0100 Subject: [PATCH] bug #3183548 [ajax] AJAX response needs HTTP header as well. Otherwise we would use default charset from PHP insted of utf-8 we use. --- libraries/header.inc.php | 6 ++++++ sql.php | 5 ++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/libraries/header.inc.php b/libraries/header.inc.php index eaad44946..1720e80f6 100644 --- a/libraries/header.inc.php +++ b/libraries/header.inc.php @@ -183,4 +183,10 @@ if (isset($GLOBALS['is_ajax_request']) && !$GLOBALS['is_ajax_request']) { */ $GLOBALS['is_header_sent'] = true; } //end if(!$GLOBALS['is_ajax_request']) +else { + if (empty($GLOBALS['is_header_sent'])) { + require_once './libraries/header_http.inc.php'; + $GLOBALS['is_header_sent'] = true; + } +} ?> diff --git a/sql.php b/sql.php index 3a8bac4b6..427e72dbc 100644 --- a/sql.php +++ b/sql.php @@ -395,9 +395,7 @@ if (isset($GLOBALS['show_as_php']) || !empty($GLOBALS['validatequery'])) { * HTML header. */ - if($GLOBALS['is_ajax_request'] != true) { - require_once './libraries/header.inc.php'; - } + require_once './libraries/header.inc.php'; $full_err_url = (preg_match('@^(db|tbl)_@', $err_url)) ? $err_url . '&show_query=1&sql_query=' . urlencode($sql_query) : $err_url; @@ -768,6 +766,7 @@ else { } } else { + require_once './libraries/header.inc.php'; //we don't need to buffer the output in PMA_showMessage here. //set a global variable and check against it in the function $GLOBALS['buffer_message'] = false;