From 05f4c05a5628c423fee13fa0a5c24db521903620 Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Thu, 15 Mar 2007 10:32:34 +0000 Subject: [PATCH] bug #1667887 HTML maxlength --- ChangeLog | 1 + tbl_change.php | 28 ++++++---------------------- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 131ee7740..9b03bda22 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,7 @@ $HeadURL$ - bug #1627210, #1083301, #1482401 [data] warning on duplicate indexes - bug #1679055 #1050 - Table '' already exists - bug #1668724 JavaScript focus login Opera +- bug #1667887 HTML maxlength - [gui] avoid displaying a wide selector in server selection + [core] added PMA_fatalError() and made use of it . [i18n] use generic $strOptions diff --git a/tbl_change.php b/tbl_change.php index a9bef7386..365c2b0c6 100644 --- a/tbl_change.php +++ b/tbl_change.php @@ -1,6 +1,7 @@ $vrow) { 40) ? 40 : $len); - $maxlength = $len; - } + // field size should be at least 4 and max 40 + $fieldsize = min(max($len, 4), 40); echo "\n"; ?>
tabindex="" id="field__3" /> @@ -905,19 +901,8 @@ foreach ($loop_array as $vrowcount => $vrow) { } // end elseif ( binary or blob) else { - // For char or varchar, respect the maximum length (M); for other - // types (int or float), the length is not a limit on the values that - // can be entered, so let's be generous (20) (we could also use the - // real limits for each numeric type) - // 2004-04-07, it turned out that 20 was not generous enough - // for the maxlength - if ($is_char) { - $fieldsize = (($len > 40) ? 40 : $len); - $maxlength = $len; - } else { - $fieldsize = 20; - $maxlength = 99; - } // end if... else... + // field size should be at least 4 and max 40 + $fieldsize = min(max($len, 4), 40); ?> $vrow) { ?> tabindex="" id="field__3" />