diff options
Diffstat (limited to 'lib/cgi-lib.rb')
-rw-r--r-- | lib/cgi-lib.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/cgi-lib.rb b/lib/cgi-lib.rb index 2407c6b388..362d13f8d0 100644 --- a/lib/cgi-lib.rb +++ b/lib/cgi-lib.rb @@ -60,7 +60,11 @@ class CGI < SimpleDelegator read_from_cmdline end.split(/&/).each do |x| key, val = x.split(/=/,2).collect{|x|unescape(x)} - @inputs[key] += ("\0" if @inputs[key]) + (val or "") + if @inputs.include?('key') + @inputs[key] += "\0" + (val or "") + else + @inputs[key] = (val or "") + end end super(@inputs) |