summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--ChangeLog5
-rw-r--r--lib/cgi.rb4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 581f32fc3..0f3f89b25 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Feb 11 07:42:25 2007 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/cgi.rb (CGI::QueryExtension::read_multipart): Properly parse
+ a quoted-string in a Content-Disposition value.
+
Sat Feb 10 20:21:29 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* ext/win32ole/win32ole.c: add WIN32OLE#ole_query_interface.
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']))