[前][次][番号順一覧][スレッド一覧]

ruby-changes:2662

From: ko1@a...
Date: 9 Dec 2007 12:39:21 +0900
Subject: [ruby-changes:2662] nobu - Ruby:r14153 (trunk, ruby_1_8): * lib/cgi.rb (read_multipart): exclude blanks from header values.

nobu	2007-12-09 12:39:04 +0900 (Sun, 09 Dec 2007)

  New Revision: 14153

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/lib/cgi.rb
    branches/ruby_1_8/version.h
    trunk/ChangeLog
    trunk/lib/cgi.rb

  Log:
    * lib/cgi.rb (read_multipart): exclude blanks from header values.
      [ruby-list:44327]


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/lib/cgi.rb?r1=14153&r2=14152
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ChangeLog?r1=14153&r2=14152
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=14153&r2=14152
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/version.h?r1=14153&r2=14152
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/lib/cgi.rb?r1=14153&r2=14152

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 14152)
+++ ChangeLog	(revision 14153)
@@ -1,3 +1,8 @@
+Sun Dec  9 12:39:01 2007  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/cgi.rb (read_multipart): exclude blanks from header values.
+	  [ruby-list:44327]
+
 Sun Dec  9 12:18:19 2007  Nobuyoshi Nakada  <nobu@r...>
 
 	* file.c (rb_get_path): use the original object if to_path method is
Index: lib/cgi.rb
===================================================================
--- lib/cgi.rb	(revision 14152)
+++ lib/cgi.rb	(revision 14153)
@@ -978,7 +978,7 @@
     def read_multipart(boundary, content_length)
       params = Hash.new([])
       boundary = "--" + boundary
-      quoted_boundary = Regexp.quote(boundary, "n")
+      quoted_boundary = Regexp.quote(boundary)
       buf = ""
       bufsize = 10 * 1024
       boundary_end=""
@@ -1029,13 +1029,13 @@
           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
@@ -1043,7 +1043,7 @@
 	  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
@@ -1052,7 +1052,7 @@
           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)
Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 14152)
+++ ruby_1_8/ChangeLog	(revision 14153)
@@ -1,3 +1,8 @@
+Sun Dec  9 12:39:01 2007  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/cgi.rb (read_multipart): exclude blanks from header values.
+	  [ruby-list:44327]
+
 Wed Dec  5 23:38:50 2007  Nobuyoshi Nakada  <nobu@r...>
 
 	* range.c (range_each): followed step_i change.
Index: ruby_1_8/version.h
===================================================================
--- ruby_1_8/version.h	(revision 14152)
+++ ruby_1_8/version.h	(revision 14153)
@@ -1,7 +1,7 @@
 #define RUBY_VERSION "1.8.6"
-#define RUBY_RELEASE_DATE "2007-12-05"
+#define RUBY_RELEASE_DATE "2007-12-09"
 #define RUBY_VERSION_CODE 186
-#define RUBY_RELEASE_CODE 20071205
+#define RUBY_RELEASE_CODE 20071209
 #define RUBY_PATCHLEVEL 5000
 
 #define RUBY_VERSION_MAJOR 1
@@ -9,7 +9,7 @@
 #define RUBY_VERSION_TEENY 6
 #define RUBY_RELEASE_YEAR 2007
 #define RUBY_RELEASE_MONTH 12
-#define RUBY_RELEASE_DAY 5
+#define RUBY_RELEASE_DAY 9
 
 #ifdef RUBY_EXTERN
 RUBY_EXTERN const char ruby_version[];
Index: ruby_1_8/lib/cgi.rb
===================================================================
--- ruby_1_8/lib/cgi.rb	(revision 14152)
+++ ruby_1_8/lib/cgi.rb	(revision 14153)
@@ -1032,13 +1032,13 @@
           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 @@
 	  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 @@
           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)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧]