diff --git a/editing.inc.php b/editing.inc.php index 05e04fdb..a39bd585 100644 --- a/editing.inc.php +++ b/editing.inc.php @@ -71,7 +71,7 @@ function edit_type($key, $field, $collations) { function process_type($field, $collate = "COLLATE") { global $mysql, $enum_length, $unsigned; return " $field[type]" - . ($field["length"] ? "(" . (preg_match("~^\\s*(?:$enum_length)(?:\\s*,\\s*(?:$enum_length))*\\s*\$~", $field["length"]) && preg_match_all("~$enum_length~", $field["length"], $matches) ? implode(",", $matches[0]) : intval($field["length"])) . ")" : "") + . ($field["length"] ? "(" . (preg_match("~^\\s*(?:$enum_length)(?:\\s*,\\s*(?:$enum_length))*\\s*\$~", $field["length"]) && preg_match_all("~$enum_length~", $field["length"], $matches) ? implode(",", $matches[0]) : preg_replace('~[^0-9,]~', '', $field["length"])) . ")" : "") . (preg_match('~int|float|double|decimal~', $field["type"]) && in_array($field["unsigned"], $unsigned) ? " $field[unsigned]" : "") . (preg_match('~char|text|enum|set~', $field["type"]) && $field["collation"] ? " $collate '" . $mysql->escape_string($field["collation"]) . "'" : "") ;