]> git.joonet.de Git - adminer.git/commitdiff
Don't use type="number" for decimal numbers
authorJakub Vrana <jakub@vrana.cz>
Thu, 10 Jan 2013 02:42:46 +0000 (18:42 -0800)
committerJakub Vrana <jakub@vrana.cz>
Thu, 10 Jan 2013 02:42:46 +0000 (18:42 -0800)
Google Chrome formats decimal point according to locale, treats it as invalid character and trims full stop

adminer/include/functions.inc.php
changes.txt

index 6bafa5084071dda4859c20ed0aa31c9659c53942..86923205243a3b1ac1f0c84b33088b9e5c2d8142 100644 (file)
@@ -743,7 +743,7 @@ function input($field, $value, $function) {
                        // int(3) is only a display hint
                        $maxlength = (!ereg('int', $field["type"]) && preg_match('~^(\\d+)(,(\\d+))?$~', $field["length"], $match) ? ((ereg("binary", $field["type"]) ? 2 : 1) * $match[1] + ($match[3] ? 1 : 0) + ($match[2] && !$field["unsigned"] ? 1 : 0)) : ($types[$field["type"]] ? $types[$field["type"]] + ($field["unsigned"] ? 0 : 1) : 0));
                        // type='date' and type='time' display localized value which may be confusing, type='datetime' uses 'T' as date and time separator
-                       echo "<input" . (ereg('int|float|double|decimal', $field["type"]) ? " type='number'" : "") . " value='" . h($value) . "'" . ($maxlength ? " maxlength='$maxlength'" : "") . (ereg('char|binary', $field["type"]) && $maxlength > 20 ? " size='40'" : "") . "$attrs>";
+                       echo "<input" . (ereg('int', $field["type"]) ? " type='number'" : "") . " value='" . h($value) . "'" . ($maxlength ? " maxlength='$maxlength'" : "") . (ereg('char|binary', $field["type"]) && $maxlength > 20 ? " size='40'" : "") . "$attrs>";
                }
        }
 }
index d2c55070bc24549743e9d9c6db7fae63b3e5010b..38fd9a5c86758849851e8ce279a941f58d4c5e65 100644 (file)
@@ -1,5 +1,6 @@
 Adminer 3.6.3-dev:
 Treat Meta key same as Ctrl
+Don't use type="number" for decimal numbers
 
 Adminer 3.6.2 (released 2012-12-21):
 Edit values by Ctrl+click instead of double click