]> git.joonet.de Git - adminer.git/commitdiff
Use is_numeric()
authorJakub Vrana <jakub@vrana.cz>
Tue, 20 Aug 2019 07:47:01 +0000 (09:47 +0200)
committerJakub Vrana <jakub@vrana.cz>
Tue, 20 Aug 2019 07:47:01 +0000 (09:47 +0200)
adminer/include/adminer.inc.php

index daad42a329fc8d328f71bdeab452b56d88d4aa05..d8044e5f1aad215a0dc749546b55a3eb61136b29 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"]) && !preg_match('~\[~', $field["full_type"]) && preg_match('~^([0-9]*\.)?[0-9]+$~', $val) ? $val : q(($val === false ? 0 : $val)))
+                                                               ? unconvert_field($field, preg_match(number_type(), $field["type"]) && !preg_match('~\[~', $field["full_type"]) && is_numeric($val) ? $val : q(($val === false ? 0 : $val)))
                                                                : "NULL"
                                                        );
                                                }