summaryrefslogtreecommitdiff
path: root/lib/cgi/html.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/cgi/html.rb')
-rw-r--r--lib/cgi/html.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/cgi/html.rb b/lib/cgi/html.rb
index aac53f92563..74aa730be71 100644
--- a/lib/cgi/html.rb
+++ b/lib/cgi/html.rb
@@ -248,12 +248,12 @@ class CGI
if value.kind_of?(String)
checkbox(name, value) + value
else
- if value[value.size - 1] == true
- checkbox(name, value[0], true) +
- value[value.size - 2]
+ if value[-1] == true || value[-1] == false
+ checkbox(name, value[0], value[-1]) +
+ value[-2]
else
checkbox(name, value[0]) +
- value[value.size - 1]
+ value[-1]
end
end
}.join
@@ -703,12 +703,12 @@ class CGI
if value.kind_of?(String)
radio_button(name, value) + value
else
- if value[value.size - 1] == true
- radio_button(name, value[0], true) +
- value[value.size - 2]
+ if value[-1] == true || value[-1] == false
+ radio_button(name, value[0], value[-1]) +
+ value[-2]
else
radio_button(name, value[0]) +
- value[value.size - 1]
+ value[-1]
end
end
}.join