diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-07 20:08:44 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-07 20:08:44 +0000 |
commit | 12de99909b34fd885590748667769ecf6ccb3bf7 (patch) | |
tree | 164683e80b0c53ea8ad2834c47d9e45d8e65b607 | |
parent | a2eab05d610a39d462eaeef10d03799b2637e68d (diff) |
merge revision(s) 14153:
* lib/cgi.rb (read_multipart): exclude blanks from header values.
[ruby-list:44327]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@16978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/cgi.rb | 8 | ||||
-rw-r--r-- | version.h | 2 |
3 files changed, 10 insertions, 5 deletions
@@ -1,3 +1,8 @@ +Sun Jun 8 05:08:35 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * lib/cgi.rb (read_multipart): exclude blanks from header values. + [ruby-list:44327] + Sun Jun 8 05:02:25 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> * bignum.c (rb_cstr_to_inum): trailing spaces may exist at sqeezing diff --git a/lib/cgi.rb b/lib/cgi.rb index a442d44930..ccc48d8836 100644 --- a/lib/cgi.rb +++ b/lib/cgi.rb @@ -1032,13 +1032,13 @@ class CGI if "--" == $2 content_length = -1 end - boundary_end = $2.dup + boundary_end = $2.dup "" end body.rewind - /Content-Disposition:.* filename=(?:"((?:\\.|[^\"])*)"|([^;]*))/ni.match(head) + /Content-Disposition:.* filename=(?:"((?:\\.|[^\"\s])*)"|([^;\s]*))/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 @@ -1046,7 +1046,7 @@ class CGI filename = CGI::unescape(filename) end - /Content-Type: (.*)/ni.match(head) + /Content-Type: ([^\s]*)/ni.match(head) content_type = ($1 or "") (class << body; self; end).class_eval do @@ -1055,7 +1055,7 @@ class CGI define_method(:content_type) {content_type.dup.taint} end - /Content-Disposition:.* name="?([^\";]*)"?/ni.match(head) + /Content-Disposition:.* name="?([^\";\s]*)"?/ni.match(head) name = $1.dup if params.has_key?(name) @@ -2,7 +2,7 @@ #define RUBY_RELEASE_DATE "2008-06-08" #define RUBY_VERSION_CODE 186 #define RUBY_RELEASE_CODE 20080608 -#define RUBY_PATCHLEVEL 156 +#define RUBY_PATCHLEVEL 157 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 |