* lib/cgi.rb (CGI::QueryExtension::read_multipart): should quote
boundary. JVN#84798830 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5ce38775ba
commit
6b279c3d09
@ -1,3 +1,8 @@
|
|||||||
|
Mon Dec 4 08:32:25 2006 Shugo Maeda <shugo@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/cgi.rb (CGI::QueryExtension::read_multipart): should quote
|
||||||
|
boundary. JVN#84798830
|
||||||
|
|
||||||
Sun Dec 3 16:16:53 2006 Akinori MUSHA <knu@iDaemons.org>
|
Sun Dec 3 16:16:53 2006 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
* ext/digest/lib/digest/hmac.rb: Fix problems with update
|
* ext/digest/lib/digest/hmac.rb: Fix problems with update
|
||||||
|
@ -977,6 +977,7 @@ class CGI
|
|||||||
def read_multipart(boundary, content_length)
|
def read_multipart(boundary, content_length)
|
||||||
params = Hash.new([])
|
params = Hash.new([])
|
||||||
boundary = "--" + boundary
|
boundary = "--" + boundary
|
||||||
|
quoted_boundary = Regexp.quote(boundary, "n")
|
||||||
buf = ""
|
buf = ""
|
||||||
bufsize = 10 * 1024
|
bufsize = 10 * 1024
|
||||||
boundary_end=""
|
boundary_end=""
|
||||||
@ -996,7 +997,7 @@ class CGI
|
|||||||
head = nil
|
head = nil
|
||||||
body = MorphingBody.new
|
body = MorphingBody.new
|
||||||
|
|
||||||
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)
|
if (not head) and /#{EOL}#{EOL}/n.match(buf)
|
||||||
buf = buf.sub(/\A((?:.|\n)*?#{EOL})#{EOL}/n) do
|
buf = buf.sub(/\A((?:.|\n)*?#{EOL})#{EOL}/n) do
|
||||||
head = $1.dup
|
head = $1.dup
|
||||||
@ -1022,7 +1023,7 @@ class CGI
|
|||||||
content_length -= c.size
|
content_length -= c.size
|
||||||
end
|
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
|
body.print $1
|
||||||
if "--" == $2
|
if "--" == $2
|
||||||
content_length = -1
|
content_length = -1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user