Avoid displaying a Back link in a error message if we are in Ajax mode

This commit is contained in:
Marc Delisle
2011-03-23 08:10:22 -04:00
parent 701a668d35
commit 29dbdde4ff

View File

@@ -661,6 +661,14 @@ function PMA_mysqlDie($error_message = '', $the_query = '',
$_SESSION['Import_message']['message'] = $error_msg_output;
if ($exit) {
/**
* If in an Ajax request
* - avoid displaying a Back link
* - use PMA_ajaxResponse() to transmit the message and exit
*/
if($GLOBALS['is_ajax_request'] == true) {
PMA_ajaxResponse($error_msg_output, false);
}
if (! empty($back_url)) {
if (strstr($back_url, '?')) {
$back_url .= '&no_history=true';
@@ -675,12 +683,6 @@ function PMA_mysqlDie($error_message = '', $the_query = '',
$error_msg_output .= '</fieldset>' . "\n\n";
}
/**
* If in an Ajax request, don't just echo and exit. Use PMA_ajaxResponse()
*/
if($GLOBALS['is_ajax_request'] == true) {
PMA_ajaxResponse($error_msg_output, false);
}
echo $error_msg_output;
/**
* display footer and exit