summaryrefslogtreecommitdiffstats
path: root/showvotes.cgi
diff options
context:
space:
mode:
authormatty%chariot.net.au <>2001-11-17 19:29:54 +0100
committermatty%chariot.net.au <>2001-11-17 19:29:54 +0100
commit77398f5a2904dcbae2a650eb5910167ff26268f0 (patch)
tree34cfe664125cd998a74228880460376b5b2445e7 /showvotes.cgi
parent684e6deb0f1f87bd51f8fdab3b8df7d432fd12c9 (diff)
downloadbugzilla-77398f5a2904dcbae2a650eb5910167ff26268f0.tar.gz
bugzilla-77398f5a2904dcbae2a650eb5910167ff26268f0.tar.xz
Bug 104677 : Votes field (text style) on showvotes.cgi defaults to size 5, not natural size and doesn't include a maxlength attribute.
Patch by Christoper Aillon <caillon@returnzero.com>.
Diffstat (limited to 'showvotes.cgi')
-rwxr-xr-xshowvotes.cgi14
1 files changed, 8 insertions, 6 deletions
diff --git a/showvotes.cgi b/showvotes.cgi
index bb87848f0..a6928bf84 100755
--- a/showvotes.cgi
+++ b/showvotes.cgi
@@ -20,6 +20,7 @@
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
# Stephan Niemz <st.n@gmx.net>
+# Christopher Aillon <christopher@aillon.com>
use diagnostics;
use strict;
@@ -138,13 +139,14 @@ if (defined $::FORM{'bug_id'}) {
$summary = html_quote($summary);
$sum += $count;
if ($canedit) {
- my $min = $maxvotesperbug{$product}; # minimum of these two
- $min = $::prodmaxvotes{$product} if $::prodmaxvotes{$product} < $min;
- if( $min < 2 ) { # checkbox
- my $checked = $count ? ' checked' : '';
+ my $min = min($::prodmaxvotes{$product}, $maxvotesperbug{$product});
+ if ($min < 2) { # checkbox
+ my $checked = $count ? ' checked="checked"' : '';
$count = qq{<input type="checkbox" name="$id" value="1"$checked>};
- }else { # normal input
- $count = qq{<input name="$id" value="$count" size="5">};
+ }
+ else { # text input
+ my $maxlength = length $min;
+ $count = qq{<input name="$id" value="$count" size="$maxlength" maxlength="$maxlength">};
}
}
print qq{