Allow full length in limited int (thanks to Vlasta Neubauer)

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@598 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2009-05-07 19:59:57 +00:00
parent d2b1037121
commit bbacf889dc
3 changed files with 4 additions and 2 deletions

View file

@ -1,6 +1,7 @@
phpMinAdmin 1.10.1:
Highlight odd and hover rows
Partition editing comfort (bug #2783446)
Allow full length in limited int (thanks to Vlasta Neubauer)
phpMinAdmin 1.10.0:
Partitioning (MySQL 5.1)

View file

@ -48,7 +48,8 @@ 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) . '"' . (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 . ' />';
$maxlength = (!ereg('int', $field["type"]) && preg_match('~^([0-9]+)(,([0-9]+))?$~', $field["length"], $match) ? ($match[1] + ($match[3] ? 1 : 0) + ($match[2] && !$field["unsigned"] ? 1 : 0)) : ($types[$field["type"]] ? $types[$field["type"]] + ($field["unsigned"] ? 0 : 1) : 0));
echo '<input name="fields[' . $name . ']" value="' . htmlspecialchars($value) . '"' . ($maxlength ? " maxlength='$maxlength'" : "") . $onchange . ' />';
}
}
}

View file

@ -9,7 +9,7 @@ function dump_csv($row) {
}
function dump_table($table, $style, $is_view = false) {
global $mysql, $types;
global $mysql;
if ($_POST["format"] == "csv") {
echo "\xef\xbb\xbf";
if ($style) {