File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change
1
+ Mon Dec 4 08:32:25 2006 Shugo Maeda <shugo@ruby-lang.org>
2
+
3
+ * lib/cgi.rb (CGI::QueryExtension::read_multipart): should quote
4
+ boundary. JVN#84798830
5
+
1
6
Sun Dec 3 16:16:53 2006 Akinori MUSHA <knu@iDaemons.org>
2
7
3
8
* ext/digest/lib/digest/hmac.rb: Fix problems with update
Original file line number Diff line number Diff line change @@ -977,6 +977,7 @@ def params=(hash)
977
977
def read_multipart ( boundary , content_length )
978
978
params = Hash . new ( [ ] )
979
979
boundary = "--" + boundary
980
+ quoted_boundary = Regexp . quote ( boundary , "n" )
980
981
buf = ""
981
982
bufsize = 10 * 1024
982
983
boundary_end = ""
@@ -996,7 +997,7 @@ def read_multipart(boundary, content_length)
996
997
head = nil
997
998
body = MorphingBody . new
998
999
999
- until head and /#{ boundary } (?:#{ EOL } |--)/n . match ( buf )
1000
+ until head and /#{ quoted_boundary } (?:#{ EOL } |--)/n . match ( buf )
1000
1001
if ( not head ) and /#{ EOL } #{ EOL } /n . match ( buf )
1001
1002
buf = buf . sub ( /\A ((?:.|\n )*?#{ EOL } )#{ EOL } /n ) do
1002
1003
head = $1. dup
@@ -1022,7 +1023,7 @@ def read_multipart(boundary, content_length)
1022
1023
content_length -= c . size
1023
1024
end
1024
1025
1025
- buf = buf . sub ( /\A ((?:.|\n )*?)(?:[\r \n ]{1,2})?#{ boundary } ([\r \n ]{1,2}|--)/n ) do
1026
+ buf = buf . sub ( /\A ((?:.|\n )*?)(?:[\r \n ]{1,2})?#{ quoted_boundary } ([\r \n ]{1,2}|--)/n ) do
1026
1027
body . print $1
1027
1028
if "--" == $2
1028
1029
content_length = -1
You can’t perform that action at this time.
0 commit comments