mirror of
https://github.com/vrana/adminer.git
synced 2025-08-18 04:11:27 +02:00
Simplify SQL syntax errors everywhere
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1276 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
@@ -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) {
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user