1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-13 10:04:07 +02:00

Fix edit by long non-utf8 string (thanks Robert Vlach)

This commit is contained in:
Jakub Vrana
2014-06-26 14:36:47 +02:00
parent 8bd3dca2f7
commit 7e3f2d9b1d
4 changed files with 17 additions and 6 deletions

View File

@@ -443,8 +443,7 @@ username.form['auth[driver]'].onchange();
&& (!preg_match("~[\x80-\xFF]~", $val["val"]) || $is_text)
) {
$name = idf_escape($name);
$charset = charset($connection);
$cols[] = ($jush == "sql" && $is_text && !preg_match("~^$charset" . "_~", $field["collation"]) ? "CONVERT($name USING $charset)" : $name);
$cols[] = ($jush == "sql" && $is_text && !preg_match("~^utf8_~", $field["collation"]) ? "CONVERT($name USING " . charset($connection) . ")" : $name);
}
}
$return[] = ($cols ? "(" . implode("$cond OR ", $cols) . "$cond)" : "0");