From 8b11e9e7781ce300c4bc0c2f31298219e9f64185 Mon Sep 17 00:00:00 2001 From: knu Date: Sat, 10 Feb 2007 22:46:08 +0000 Subject: * 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 --- lib/cgi.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') 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'])) -- cgit v1.2.3