ruby-changes:43868
From: usa <ko1@a...>
Date: Tue, 16 Aug 2016 21:02:41 +0900 (JST)
Subject: [ruby-changes:43868] usa:r55941 (ruby_2_2): merge revision(s) 55563: [Backport #12498]
usa 2016-08-16 21:02:37 +0900 (Tue, 16 Aug 2016) New Revision: 55941 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55941 Log: merge revision(s) 55563: [Backport #12498] * lib/uri/mailto.rb (initialize): RFC3986_Parser#split sets opaque only if the URI has path-rootless, not path-empty. [ruby-core:76055] [Bug #12498] patched by Chris Heisterkamp <cheister@s...> Modified directories: branches/ruby_2_2/ Modified files: branches/ruby_2_2/ChangeLog branches/ruby_2_2/lib/uri/mailto.rb branches/ruby_2_2/test/uri/test_mailto.rb branches/ruby_2_2/version.h Index: ruby_2_2/ChangeLog =================================================================== --- ruby_2_2/ChangeLog (revision 55940) +++ ruby_2_2/ChangeLog (revision 55941) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1 +Tue Aug 16 21:01:55 2016 NARUSE, Yui <naruse@r...> + + * lib/uri/mailto.rb (initialize): RFC3986_Parser#split sets opaque + only if the URI has path-rootless, not path-empty. + [ruby-core:76055] [Bug #12498] + patched by Chris Heisterkamp <cheister@s...> + Tue Aug 16 20:59:35 2016 Nobuyoshi Nakada <nobu@r...> * ext/date/date_strftime.c (date_strftime_with_tmx): reject too Index: ruby_2_2/lib/uri/mailto.rb =================================================================== --- ruby_2_2/lib/uri/mailto.rb (revision 55940) +++ ruby_2_2/lib/uri/mailto.rb (revision 55941) @@ -135,6 +135,9 @@ module URI https://github.com/ruby/ruby/blob/trunk/ruby_2_2/lib/uri/mailto.rb#L135 @to = nil @headers = [] + # The RFC3986 parser does not normally populate opaque + @opaque = "?#{@query}" if @query && !@opaque + unless @opaque raise InvalidComponentError, "missing opaque part for mailto URL" Index: ruby_2_2/version.h =================================================================== --- ruby_2_2/version.h (revision 55940) +++ ruby_2_2/version.h (revision 55941) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1 #define RUBY_VERSION "2.2.6" #define RUBY_RELEASE_DATE "2016-08-16" -#define RUBY_PATCHLEVEL 367 +#define RUBY_PATCHLEVEL 368 #define RUBY_RELEASE_YEAR 2016 #define RUBY_RELEASE_MONTH 8 Index: ruby_2_2/test/uri/test_mailto.rb =================================================================== --- ruby_2_2/test/uri/test_mailto.rb (revision 55940) +++ ruby_2_2/test/uri/test_mailto.rb (revision 55941) @@ -111,13 +111,15 @@ class TestMailTo < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/uri/test_mailto.rb#L111 bad << ["foo@e...?subject=1+1=2", []] ok.each do |x| - assert_equal(x[0], - @u.build(x[1]).to_s) - assert_equal(x[0], - @u.build(x[2]).to_s) + assert_equal(x[0], URI.parse(x[0]).to_s) + assert_equal(x[0], @u.build(x[1]).to_s) + assert_equal(x[0], @u.build(x[2]).to_s) end bad.each do |x| + assert_raise(URI::InvalidURIError) { + URI.parse(x) + } assert_raise(URI::InvalidComponentError) { @u.build(x) } Property changes on: ruby_2_2 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r55563 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/