]> git.joonet.de Git - adminer.git/commitdiff
Always allow yyyy-mm-dd
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Thu, 20 Aug 2009 15:37:39 +0000 (15:37 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Thu, 20 Aug 2009 15:37:39 +0000 (15:37 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@988 7c3ca157-0c34-0410-bff1-cbf682f78f5c

editor/include/adminer.inc.php

index 80d350d305dbd9a5020adfb840e4be9320255774..69e08a4bc1468e5f1a209d15a437220cd23cfabd 100644 (file)
@@ -326,7 +326,7 @@ ORDER BY ORDINAL_POSITION"); //! requires MySQL 5
                if ($function == "now") {
                        return "$function()";
                }
-               $return = $dbh->quote(ereg('date|timestamp', $field["type"]) && preg_match('(^' . preg_replace('~(\\\\\\$([0-9]))~', '(?P<p\\2>[0-9]+)', preg_quote(lang('$1-$3-$5'))) . '(.*))', $value, $match) //! {1,2} instead of + except year
+               $return = $dbh->quote(ereg('date|timestamp', $field["type"]) && preg_match('(^' . str_replace('\\$1', '(?P<p1>[0-9]+)', preg_replace('~(\\\\\\$([2-6]))~', '(?P<p\\2>[0-9]{1,2})', 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]" . end($match)
                        : $value
                );