]> git.joonet.de Git - adminer.git/commitdiff
Regexp (?P<>) is not supported with preg_replace_callback in older PHP versions
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Thu, 30 Jul 2009 09:25:37 +0000 (09:25 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Thu, 30 Jul 2009 09:25:37 +0000 (09:25 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@947 7c3ca157-0c34-0410-bff1-cbf682f78f5c

editor/include/adminer.inc.php
editor/include/editing.inc.php

index 9d6fa7538155122769321d95e0efae25cacb28ce..0527549d12595c044ac6a69ddcaa81d6214d9569 100644 (file)
@@ -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<p\\2>[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<p\\2>[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") {
index 3c905a4d193a0e05af7610a338f9427a989919b9..a4abe2dafcb3fabac023b6d4630c24fed41379c0 100644 (file)
@@ -1,4 +1,2 @@
 <?php
-function conversion_date($match) {
-       return ($match["p1"] ? $match["p1"] : ($match["p2"] < 70 ? 20 : 19) . $match["p2"]) . "-$match[p3]$match[p4]-$match[p5]$match[p6]";
-}
+