diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-12-03 08:06:27 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-12-03 08:06:27 +0000 |
commit | a89dee27147be28d294705b0d97987b3c566258f (patch) | |
tree | 01130b5db80a3a94c2aebdad3800477b2bfb862c /lib | |
parent | 7928b08c0e34c94862f58ee6a799d37ebc8479a0 (diff) |
* lib/cgi.rb (CGI::QueryExtension::read_multipart): should quote
boundary. JVN#84798830
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_5@11326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cgi.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/cgi.rb b/lib/cgi.rb index 7303cccdbe..ac80d91799 100644 --- a/lib/cgi.rb +++ b/lib/cgi.rb @@ -967,6 +967,7 @@ class CGI def read_multipart(boundary, content_length) params = Hash.new([]) boundary = "--" + boundary + quoted_boundary = Regexp.quote(boundary, "n") buf = "" bufsize = 10 * 1024 boundary_end="" @@ -998,7 +999,7 @@ class CGI end body.binmode if defined? body.binmode - until head and /#{boundary}(?:#{EOL}|--)/n.match(buf) + until head and /#{quoted_boundary}(?:#{EOL}|--)/n.match(buf) if (not head) and /#{EOL}#{EOL}/n.match(buf) buf = buf.sub(/\A((?:.|\n)*?#{EOL})#{EOL}/n) do @@ -1025,7 +1026,7 @@ class CGI content_length -= c.size end - buf = buf.sub(/\A((?:.|\n)*?)(?:[\r\n]{1,2})?#{boundary}([\r\n]{1,2}|--)/n) do + buf = buf.sub(/\A((?:.|\n)*?)(?:[\r\n]{1,2})?#{quoted_boundary}([\r\n]{1,2}|--)/n) do body.print $1 if "--" == $2 content_length = -1 |