diff --git a/libraries/Util.class.php b/libraries/Util.class.php index 60fac94d5c..e694cedcd4 100644 --- a/libraries/Util.class.php +++ b/libraries/Util.class.php @@ -603,7 +603,8 @@ class PMA_Util } /** - * Displays a MySQL error message in the right frame. + * Displays a MySQL error message in the right frame when $exit is true. + * Returns the error message otherwise. * * @param string $error_message the error message * @param string $the_query the sql query that failed @@ -611,7 +612,7 @@ class PMA_Util * @param string $back_url the "back" link url (full path is not required) * @param bool $exit EXIT the page? * - * @return void + * @return mixed * * @global string the curent table * @global string the current db @@ -765,7 +766,7 @@ class PMA_Util echo $error_msg; exit; } else { - echo $error_msg; + return $error_msg; } } // end of the 'mysqlDie()' function diff --git a/libraries/plugins/auth/AuthenticationConfig.class.php b/libraries/plugins/auth/AuthenticationConfig.class.php index 7719a1d4d6..6bfc5e352d 100644 --- a/libraries/plugins/auth/AuthenticationConfig.class.php +++ b/libraries/plugins/auth/AuthenticationConfig.class.php @@ -126,7 +126,7 @@ class AuthenticationConfig extends AuthenticationPlugin ), E_USER_WARNING ); } - PMA_Util::mysqlDie( + echo PMA_Util::mysqlDie( $conn_error, '', true, '', false ); } diff --git a/tbl_create.php b/tbl_create.php index 490a49c13a..bc6524e2e4 100644 --- a/tbl_create.php +++ b/tbl_create.php @@ -420,7 +420,7 @@ if (isset($_REQUEST['do_save_data'])) { $response->isSuccess(false); $response->addJSON('message', PMA_DBI_getError()); } else { - PMA_Util::mysqlDie('', '', '', $err_url, false); + echo PMA_Util::mysqlDie('', '', '', $err_url, false); // An error happened while inserting/updating a table definition. // To prevent total loss of that data, we embed the form once again. // The variable $regenerate will be used to restore data in diff --git a/tbl_relation.php b/tbl_relation.php index 6854d22c0d..f42c1a88c6 100644 --- a/tbl_relation.php +++ b/tbl_relation.php @@ -210,12 +210,9 @@ if (isset($_REQUEST['destination_foreign'])) { if (substr($tmp_error_create, 1, 4) == '1216' || substr($tmp_error_create, 1, 4) == '1452' ) { - ob_start(); - PMA_Util::mysqlDie( + $html_output .= PMA_Util::mysqlDie( $tmp_error_create, $create_query, false, '', false ); - $html_output .= ob_get_contents(); - ob_end_clean(); $html_output .= PMA_Util::showMySQLDocu( 'manual_Table_types', 'InnoDB_foreign_key_constraints' ) . "\n";