diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-02-10 22:46:08 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-02-10 22:46:08 +0000 |
commit | 8b11e9e7781ce300c4bc0c2f31298219e9f64185 (patch) | |
tree | 32f9f3df930db573cf9946d431c0a315667425f8 /lib | |
parent | 7634900b4e12f75bf34ef2c1dea878812df7734a (diff) | |
download | ruby-8b11e9e7781ce300c4bc0c2f31298219e9f64185.tar.gz |
* lib/cgi.rb (CGI::QueryExtension::read_multipart): Properly parse
a quoted-string in a Content-Disposition value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cgi.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/cgi.rb b/lib/cgi.rb index b6e432eb48..92ec1b6d57 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'])) |