1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-08 07:36:44 +02:00

Make maxlength in edit fields a soft limit

This commit is contained in:
Jakub Vrana
2016-09-19 17:21:41 +02:00
parent 682e86d236
commit 9872229e11
4 changed files with 13 additions and 4 deletions

View File

@@ -914,7 +914,7 @@ function input($field, $value, $function) {
// type='date' and type='time' display localized value which may be confusing, type='datetime' uses 'T' as date and time separator
echo "<input"
. ((!$has_function || $function === "") && preg_match('~(?<!o)int~', $field["type"]) ? " type='number'" : "")
. " value='" . h($value) . "'" . ($maxlength ? " maxlength='$maxlength'" : "")
. " value='" . h($value) . "'" . ($maxlength ? " data-maxlength='$maxlength'" : "")
. (preg_match('~char|binary~', $field["type"]) && $maxlength > 20 ? " size='40'" : "")
. "$attrs>"
;