diff --git a/libraries/Response.class.php b/libraries/Response.class.php index 1bc183293c99..10845aa43335 100644 --- a/libraries/Response.class.php +++ b/libraries/Response.class.php @@ -66,6 +66,13 @@ class PMA_Response * @var bool */ private $_isAjax; + /** + * Whether response object is disabled + * + * @access private + * @var bool + */ + private $_isDisabled; /** * Whether we are servicing an ajax request for a page * that was fired using the generic page handler in JS. @@ -109,6 +116,7 @@ private function __construct() $this->_isSuccess = true; $this->_isAjax = false; $this->_isAjaxPage = false; + $this->_isDisabled = false; if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) { $this->_isAjax = true; } @@ -181,6 +189,7 @@ public function disable() { $this->_header->disable(); $this->_footer->disable(); + $this->_isDisabled = true; } /** @@ -280,6 +289,12 @@ private function _htmlResponse() */ private function _ajaxResponse() { + /* Avoid wrapping in case we're disabled */ + if ($this->_isDisabled) { + echo $this->_getDisplay(); + return; + } + if (! isset($this->_JSON['message'])) { $this->_JSON['message'] = $this->_getDisplay(); } else if ($this->_JSON['message'] instanceof PMA_Message) {