From 2fb2d208c057fd86029caa7267032707f9e668ba Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Wed, 31 Jan 2018 16:46:50 +0100 Subject: [PATCH] Quote default values not starting with a letter --- adminer/include/editing.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adminer/include/editing.inc.php b/adminer/include/editing.inc.php index f6892248..ba14a8aa 100644 --- a/adminer/include/editing.inc.php +++ b/adminer/include/editing.inc.php @@ -198,7 +198,7 @@ function process_field($field, $type_field) { idf_escape(trim($field["field"])), process_type($type_field), ($field["null"] ? " NULL" : " NOT NULL"), // NULL for timestamp - (isset($default) ? " DEFAULT " . (preg_match('~char|binary|text|enum|set~', $field["type"]) || preg_match('~^[\\d.]+[^\\d.]~', $default) ? q($default) : $default) : ""), + (isset($default) ? " DEFAULT " . (preg_match('~char|binary|text|enum|set~', $field["type"]) || preg_match('~^(?![a-z])~i', $default) ? q($default) : $default) : ""), (preg_match('~timestamp|datetime~', $field["type"]) && $field["on_update"] ? " ON UPDATE $field[on_update]" : ""), (support("comment") && $field["comment"] != "" ? " COMMENT " . q($field["comment"]) : ""), ($field["auto_increment"] ? auto_increment() : null),