diff --git a/adminer/call.inc.php b/adminer/call.inc.php index f9871d53..8753e90e 100644 --- a/adminer/call.inc.php +++ b/adminer/call.inc.php @@ -30,7 +30,7 @@ if (!$error && $_POST) { } $result = $connection->multi_query((isset($_GET["callf"]) ? "SELECT" : "CALL") . " " . idf_escape($PROCEDURE) . "(" . implode(", ", $call) . ")"); if (!$result) { - echo "
" . h($connection->error) . "\n"; + echo "
" . error() . "\n"; } else { do { $result = $connection->store_result(); diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 21d1c13e..dba76517 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -246,7 +246,7 @@ function query_redirect($query, $location, $message, $redirect = true, $execute $sql = $adminer->messageQuery($query); } if ($failed) { - $error = h($connection->error) . $sql; + $error = error() . $sql; return false; } if ($redirect) { diff --git a/adminer/include/mysql.inc.php b/adminer/include/mysql.inc.php index 3b3dcc56..11e495f1 100644 --- a/adminer/include/mysql.inc.php +++ b/adminer/include/mysql.inc.php @@ -372,6 +372,14 @@ function information_schema($db) { return ($connection->server_info >= 5 && $db == "information_schema"); } +/** Get escaped error message +* @return string +*/ +function error() { + global $connection; + return h(preg_replace('~^You have an error.*syntax to use~U', "Syntax error", $connection->error)); +} + /** Return expression for binary comparison * @param string * @return string diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 4531fa6b..b7d4917f 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -144,7 +144,7 @@ if (isset($rights["insert"])) { $adminer->selectLinks($table_status, $set); if (!$columns) { - echo "
" . lang('Unable to select the table') . ($fields ? "" : ": " . h($connection->error)) . ".\n"; + echo "
" . lang('Unable to select the table') . ($fields ? "" : ": " . error()) . ".\n"; } else { echo "