summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-10 22:46:08 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-10 22:46:08 +0000
commitad5efce56dc14340202a37778f7b3364a44250ca (patch)
tree32f9f3df930db573cf9946d431c0a315667425f8 /lib
parent119f82e8d40091cac587235014f655f3de913bd9 (diff)
downloadruby-ad5efce56dc14340202a37778f7b3364a44250ca.tar.gz
ruby-ad5efce56dc14340202a37778f7b3364a44250ca.tar.xz
ruby-ad5efce56dc14340202a37778f7b3364a44250ca.zip
* lib/cgi.rb (CGI::QueryExtension::read_multipart): Properly parse
a quoted-string in a Content-Disposition value. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@11699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/cgi.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/cgi.rb b/lib/cgi.rb
index b6e432eb4..92ec1b6d5 100644
--- a/lib/cgi.rb
+++ b/lib/cgi.rb
@@ -1034,8 +1034,8 @@ class CGI
body.rewind
- /Content-Disposition:.* filename="?([^\";]*)"?/ni.match(head)
- filename = ($1 or "")
+ /Content-Disposition:.* filename=(?:"((?:\\.|[^\"])*)"|([^;]*))/ni.match(head)
+ filename = ($1 or $2 or "")
if /Mac/ni.match(env_table['HTTP_USER_AGENT']) and
/Mozilla/ni.match(env_table['HTTP_USER_AGENT']) and
(not /MSIE/ni.match(env_table['HTTP_USER_AGENT']))