]> git.joonet.de Git - adminer.git/commitdiff
Support unquoted floats in export
authorJakub Vrana <jakub@vrana.cz>
Mon, 19 Aug 2019 15:18:56 +0000 (17:18 +0200)
committerJakub Vrana <jakub@vrana.cz>
Mon, 19 Aug 2019 15:18:56 +0000 (17:18 +0200)
adminer/include/adminer.inc.php

index ca193f4b80b6b3f8df202d2a9a7893c2465e8839..daad42a329fc8d328f71bdeab452b56d88d4aa05 100644 (file)
@@ -845,7 +845,7 @@ class Adminer {
                                                foreach ($row as $key => $val) {
                                                        $field = $fields[$key];
                                                        $row[$key] = ($val !== null
-                                                               ? unconvert_field($field, preg_match(number_type(), $field["type"]) && $val != '' && !preg_match('~\[~', $field["full_type"]) && preg_match('~^[0-9]+$~', $val) ? $val : q(($val === false ? 0 : $val)))
+                                                               ? unconvert_field($field, preg_match(number_type(), $field["type"]) && !preg_match('~\[~', $field["full_type"]) && preg_match('~^([0-9]*\.)?[0-9]+$~', $val) ? $val : q(($val === false ? 0 : $val)))
                                                                : "NULL"
                                                        );
                                                }