diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php
index 5e2f3adf..65e0dffc 100644
--- a/adminer/include/adminer.inc.php
+++ b/adminer/include/adminer.inc.php
@@ -459,7 +459,7 @@ username.form['driver'].onchange();
*/
function processInput($field, $value, $function = "") {
$name = $field["field"];
- $return = q($value);
+ $return = ($field["type"] == "bit" && ereg('^[0-9]+$', $value) ? $value : q($value));
if (ereg('^(now|getdate|uuid)$', $function)) {
$return = "$function()";
} elseif (ereg('^current_(date|timestamp)$', $function)) {
diff --git a/editor/include/adminer.inc.php b/editor/include/adminer.inc.php
index d5fc28c6..fddcc625 100644
--- a/editor/include/adminer.inc.php
+++ b/editor/include/adminer.inc.php
@@ -164,13 +164,13 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
$return = "";
}
}
- if ($field["full_type"] == "tinyint(1)" && $return != " ") { // bool
+ if (ereg("(tinyint|bit)\\(1\\)", $field["full_type"]) && $return != " ") { // bool
$return = '
';
}
if ($link) {
$return = "$return";
}
- if (!$link && $field["full_type"] != "tinyint(1)" && ereg('int|float|double|decimal', $field["type"])) {
+ if (!$link && !ereg("(tinyint|bit)\\(1\\)", $field["full_type"]) && ereg('int|float|double|decimal', $field["type"])) {
$return = "
\\d{1,2})', preg_quote(lang('$1-$3-$5')))) . '(.*))', $value, $match)) { $return = ($match["p1"] != "" ? $match["p1"] : ($match["p2"] != "" ? ($match["p2"] < 70 ? 20 : 19) . $match["p2"] : gmdate("Y"))) . "-$match[p3]$match[p4]-$match[p5]$match[p6]" . end($match); } - $return = q($return); - if (!ereg('char|text', $field["type"]) && $field["full_type"] != "tinyint(1)" && $value == "") { + $return = ($field["type"] == "bit" && ereg('^[0-9]+$', $value) ? $return : q($return)); + if (!ereg('char|text', $field["type"]) && !ereg("(tinyint|bit)\\(1\\)", $field["full_type"]) && $value == "") { $return = "NULL"; } elseif (ereg('^(md5|sha1)$', $function)) { $return = "$function($return)"; diff --git a/todo.txt b/todo.txt index cbca945f..656164b8 100644 --- a/todo.txt +++ b/todo.txt @@ -23,7 +23,6 @@ Add whisperer to fields with foreign key to big table JS calendar for date fields MySQL: -Saving of MySQL 5 BIT data type - don't use quote() Data longer than max_allowed_packet can be sent by mysqli_stmt_send_long_data() ? Geometry support