summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib/cgi.rb14
2 files changed, 12 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 9ee394042f..f3dbdd9d2c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Sep 14 07:30:56 2009 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/cgi/cookie.rb (value): Keep CGI::Cookie#value in sync with the
+ cookie itself. A patch by Arthur Schreiber [ruby-core:17634]
+
Mon Sep 14 04:57:27 2009 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
* lib/irb/ext/multi-irb.rb: Fix arguments handling for shell commands
diff --git a/lib/cgi.rb b/lib/cgi.rb
index c9dfac616f..94f5dcba7b 100644
--- a/lib/cgi.rb
+++ b/lib/cgi.rb
@@ -822,8 +822,8 @@ class CGI
super(@value)
end
- attr_accessor("name", "value", "path", "domain", "expires")
- attr_reader("secure")
+ attr_accessor("name", "path", "domain", "expires")
+ attr_reader("secure", "value")
# Set whether the Cookie is a secure cookie or not.
#
@@ -833,16 +833,16 @@ class CGI
@secure
end
+ def value=(val)
+ @value.replace(Array(val))
+ end
+
# Convert the Cookie to its string representation.
def to_s
buf = ""
buf += @name + '='
- if @value.kind_of?(String)
- buf += CGI::escape(@value)
- else
- buf += @value.collect{|v| CGI::escape(v) }.join("&")
- end
+ buf += @value.map { |v| CGI::escape(v) }.join("&")
if @domain
buf += '; domain=' + @domain