]> git.joonet.de Git - adminer.git/commitdiff
Function is_numeric is too generous
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Tue, 21 Jul 2009 16:04:07 +0000 (16:04 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Tue, 21 Jul 2009 16:04:07 +0000 (16:04 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@866 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/include/export.inc.php

index 3f88bc321de777d15e00619380a663c9b477cf5c..f96aa650c7a4615ab34371521521ae35d0825006 100644 (file)
@@ -112,7 +112,7 @@ function dump_data($table, $style, $select = "") {
                                        $insert = "INSERT INTO " . idf_escape($table) . " (" . implode(", ", array_map('idf_escape', array_keys($row))) . ") VALUES";
                                        $row2 = array();
                                        foreach ($row as $key => $val) {
-                                               $row2[$key] = (isset($val) ? (is_numeric($val) ? $val : $dbh->quote($val)) : "NULL");
+                                               $row2[$key] = (isset($val) ? (ereg('^(0|-?[1-9][0-9]*(\\.[0-9]+)?|0\\.[0-9]+)$', $val) ? $val : $dbh->quote($val)) : "NULL"); // strings -0, -0.0, 1., 01, .5 would translate to 0, 0.0, 1, 1, 0.5
                                        }
                                        if ($style == "INSERT+UPDATE") {
                                                $set = array();