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

ruby-changes:36869

From: naruse <ko1@a...>
Date: Wed, 24 Dec 2014 03:20:02 +0900 (JST)
Subject: [ruby-changes:36869] naruse:r48950 (ruby_2_2): merge revision(s) 48934: [Backport #10619]

naruse	2014-12-24 03:19:45 +0900 (Wed, 24 Dec 2014)

  New Revision: 48950

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

  Log:
    merge revision(s) 48934: [Backport #10619]
    
    * lib/uri/generic.rb (URI::Generic#query=): don't escape [\]^
      on both rfc2396 and rfc3986. [Bug #10619]

  Modified directories:
    branches/ruby_2_2/
  Modified files:
    branches/ruby_2_2/ChangeLog
    branches/ruby_2_2/lib/uri/generic.rb
    branches/ruby_2_2/test/uri/test_generic.rb
Index: ruby_2_2/ChangeLog
===================================================================
--- ruby_2_2/ChangeLog	(revision 48949)
+++ ruby_2_2/ChangeLog	(revision 48950)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1
+Wed Dec 24 03:16:32 2014  NARUSE, Yui  <naruse@r...>
+
+	* lib/uri/generic.rb (URI::Generic#query=): don't escape [\]^
+	  on both rfc2396 and rfc3986. [Bug #10619]
+
 Wed Dec 24 03:12:28 2014  Eric Wong  <e@8...>
 
 	* test/test_weakref.rb (test_repeated_object_leak): increase timeout
Index: ruby_2_2/lib/uri/generic.rb
===================================================================
--- ruby_2_2/lib/uri/generic.rb	(revision 48949)
+++ ruby_2_2/lib/uri/generic.rb	(revision 48950)
@@ -851,7 +851,7 @@ module URI https://github.com/ruby/ruby/blob/trunk/ruby_2_2/lib/uri/generic.rb#L851
       v.encode!(Encoding::UTF_8) rescue nil
       v.delete!("\t\r\n")
       v.force_encoding(Encoding::ASCII_8BIT)
-      v.gsub!(/(?!%\h\h|[!$-&(-;=?-Z_a-~])./n.freeze){'%%%02X'.freeze % $&.ord}
+      v.gsub!(/(?!%\h\h|[!$-&(-;=?-_a-~])./n.freeze){'%%%02X'.freeze % $&.ord}
       v.force_encoding(Encoding::US_ASCII)
       @query = v
     end
Index: ruby_2_2/test/uri/test_generic.rb
===================================================================
--- ruby_2_2/test/uri/test_generic.rb	(revision 48949)
+++ ruby_2_2/test/uri/test_generic.rb	(revision 48950)
@@ -714,9 +714,9 @@ class URI::TestGeneric < Test::Unit::Tes https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/uri/test_generic.rb#L714
     assert_equal('b123', uri.fragment = 'b123')
     assert_equal('http://foo:bar@zab:8080/?a=1#b123', uri.to_s)
     assert_equal('a[]=1', uri.query = 'a[]=1')
-    assert_equal('http://foo:bar@zab:8080/?a%5B%5D=1#b123', uri.to_s)
+    assert_equal('http://foo:bar@zab:8080/?a[]=1#b123', uri.to_s)
     uri = URI.parse('http://foo:bar@zab:8080/?a[]=1#b123')
-    assert_equal('http://foo:bar@zab:8080/?a%5B%5D=1#b123', uri.to_s)
+    assert_equal('http://foo:bar@zab:8080/?a[]=1#b123', uri.to_s)
 
     uri = URI.parse('http://example.com')
     assert_raise(URI::InvalidURIError) { uri.password = 'bar' }

Property changes on: ruby_2_2
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r48934


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

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