diff --git a/editor/include/adminer.inc.php b/editor/include/adminer.inc.php index 9d6fa753..0527549d 100644 --- a/editor/include/adminer.inc.php +++ b/editor/include/adminer.inc.php @@ -314,7 +314,10 @@ ORDER BY ORDINAL_POSITION"); //! requires MySQL 5 function processInput($field, $value, $function = "") { global $dbh; - $return = $dbh->quote(ereg('date|timestamp', $field["type"]) ? preg_replace_callback('(' . preg_replace('~(\\\\\\$([0-9]))~', '(?P[0-9]+)', preg_quote(lang('$1-$3-$5'))) . ')', 'conversion_date', $value) : $value); + $return = $dbh->quote(ereg('date|timestamp', $field["type"]) && preg_match('(^' . preg_replace('~(\\\\\\$([0-9]))~', '(?P[0-9]+)', preg_quote(lang('$1-$3-$5'))) . ')', $value, $match) + ? ($match["p1"] ? $match["p1"] : ($match["p2"] < 70 ? 20 : 19) . $match["p2"]) . "-$match[p3]$match[p4]-$match[p5]$match[p6]" + : $value + ); if (!ereg('varchar|text', $field["type"]) && $field["full_type"] != "tinyint(1)" && !strlen($value)) { $return = "NULL"; } elseif (ereg('date|time', $field["type"]) && $value == "CURRENT_TIMESTAMP") { diff --git a/editor/include/editing.inc.php b/editor/include/editing.inc.php index 3c905a4d..a4abe2da 100644 --- a/editor/include/editing.inc.php +++ b/editor/include/editing.inc.php @@ -1,4 +1,2 @@