maxlength for decimal and float types (bug #1920166)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@378 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
dcc88f4731
commit
312a0667b1
|
@ -31,7 +31,7 @@ function input($name, $field, $value) {
|
||||||
} elseif (preg_match('~binary|blob~', $field["type"])) {
|
} elseif (preg_match('~binary|blob~', $field["type"])) {
|
||||||
echo (ini_get("file_uploads") ? '<input type="file" name="' . $name . '"' . $onchange . ' />' : lang('File uploads are disabled.') . ' ');
|
echo (ini_get("file_uploads") ? '<input type="file" name="' . $name . '"' . $onchange . ' />' : lang('File uploads are disabled.') . ' ');
|
||||||
} else {
|
} else {
|
||||||
echo '<input name="fields[' . $name . ']" value="' . htmlspecialchars($value) . '"' . (strlen($field["length"]) ? " maxlength='$field[length]'" : ($types[$field["type"]] ? " maxlength='" . $types[$field["type"]] . "'" : '')) . $onchange . ' />';
|
echo '<input name="fields[' . $name . ']" value="' . htmlspecialchars($value) . '"' . (preg_match('~^([0-9]+)(,([0-9]+))?$~', $field["length"], $match) ? " maxlength='" . ($match[1] + ($match[3] ? 1 : 0) + ($match[2] && !$field["unsigned"] ? 1 : 0)) . "'" : ($types[$field["type"]] ? " maxlength='" . $types[$field["type"]] . "'" : '')) . $onchange . ' />';
|
||||||
}
|
}
|
||||||
if ($field["null"] && $field["type"] != "enum") {
|
if ($field["null"] && $field["type"] != "enum") {
|
||||||
$id = "null-$name";
|
$id = "null-$name";
|
||||||
|
|
Loading…
Reference in a new issue