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

ruby-changes:8087

From: xibbar <ko1@a...>
Date: Sun, 28 Sep 2008 22:54:49 +0900 (JST)
Subject: [ruby-changes:8087] Ruby:r19613 (trunk): * lib/cgi/core.rb (CGI::parse): ignore illegal query params.

xibbar	2008-09-28 22:54:28 +0900 (Sun, 28 Sep 2008)

  New Revision: 19613

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19613

  Log:
    * lib/cgi/core.rb (CGI::parse): ignore illegal query params.
    [ruby-dev:36618]

  Modified files:
    trunk/ChangeLog
    trunk/lib/cgi/core.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 19612)
+++ ChangeLog	(revision 19613)
@@ -1,3 +1,8 @@
+Sun Sep 28 22:44:26 2008  Takeyuki Fujioka  <xibbar@r...>
+
+	* lib/cgi/core.rb (CGI::parse): ignore illegal query params.
+	[ruby-dev:36618]
+
 Sun Sep 28 22:05:07 2008  Yusuke Endoh  <mame@t...>
 
 	* compile.c (iseq_set_sequence): check duplicated when clause.
Index: lib/cgi/core.rb
===================================================================
--- lib/cgi/core.rb	(revision 19612)
+++ lib/cgi/core.rb	(revision 19613)
@@ -337,7 +337,9 @@
     params = {}
     query.split(/[&;]/).each do |pairs|
       key, value = pairs.split('=',2).collect{|v| CGI::unescape(v) }
-      params.has_key?(key) ? params[key].push(value) : params[key] = [value]
+      if key && value
+        params.has_key?(key) ? params[key].push(value) : params[key] = [value]
+      end
     end
     params.default=[].freeze
     params

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

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