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:
jakubvrana 2008-03-20 12:50:35 +00:00
parent dcc88f4731
commit 312a0667b1

View file

@ -31,7 +31,7 @@ function input($name, $field, $value) {
} elseif (preg_match('~binary|blob~', $field["type"])) {
echo (ini_get("file_uploads") ? '<input type="file" name="' . $name . '"' . $onchange . ' />' : lang('File uploads are disabled.') . ' ');
} 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") {
$id = "null-$name";