summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-10 22:47:19 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-10 22:47:19 +0000
commiteda936e63cbf1ff7d77b0a4f66225ed704549696 (patch)
tree929a81c556987a1da665aa704b23d4898ca00b12
parent02db1bdf776c06839de78e557f8259f2c3803e5b (diff)
* 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/branches/ruby_1_8@11701 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 acd4bb8be9..e47630fdc9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Feb 11 07:46:45 2007 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/cgi.rb (CGI::QueryExtension::read_multipart): Properly parse
+ a quoted-string in a Content-Disposition value.
+
Sun Feb 11 06:27:54 2007 Akinori MUSHA <knu@iDaemons.org>
* configure.in, ext/thread/extconf.rb, lib/thread.rb: Add a
diff --git a/lib/cgi.rb b/lib/cgi.rb
index 38407da5cc..94d92e25ae 100644
--- a/lib/cgi.rb
+++ b/lib/cgi.rb
@@ -1037,8 +1037,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']))