diff --git a/adminer/edit.inc.php b/adminer/edit.inc.php index 951be334..a6334351 100644 --- a/adminer/edit.inc.php +++ b/adminer/edit.inc.php @@ -78,6 +78,10 @@ if ($fields) { $value = $adminer->editVal($value, $field); } $function = ($_POST["save"] ? (string) $_POST["function"][$name] : ($where && $field["on_update"] == "CURRENT_TIMESTAMP" ? "now" : ($value === false ? null : (isset($value) ? '' : 'NULL')))); + if ($field["type"] == "timestamp" && $value == "CURRENT_TIMESTAMP") { + $value = ""; + $function = "now"; + } input($field, $value, $function); echo "\n"; } diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 2cbfa2d1..a619a8f7 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -400,8 +400,6 @@ class Adminer { $return = "$function(" . idf_escape($name) . ", $return)"; } elseif (ereg('^(md5|sha1|password)$', $function)) { $return = "$function($return)"; - } elseif (ereg('date|time', $field["type"]) && $value == "CURRENT_TIMESTAMP") { - $return = $value; } return $return; } diff --git a/editor/include/adminer.inc.php b/editor/include/adminer.inc.php index b82cc2de..feb73935 100644 --- a/editor/include/adminer.inc.php +++ b/editor/include/adminer.inc.php @@ -331,8 +331,6 @@ ORDER BY ORDINAL_POSITION"); //! requires MySQL 5 ); if (!ereg('varchar|text', $field["type"]) && $field["full_type"] != "tinyint(1)" && !strlen($value)) { $return = "NULL"; - } elseif (ereg('date|time', $field["type"]) && $value == "CURRENT_TIMESTAMP") { - $return = $value; } return $return; }