From 21ab98a997d2ed44c9c95cf5434a42561b2cd688 Mon Sep 17 00:00:00 2001 From: naruse Date: Mon, 3 Nov 2014 00:33:47 +0000 Subject: * lib/uri/rfc3986_parser.rb (URI::RFC3986_Parser::RFC3986_URI): allow '[' and ']' for URI input (and escape). [Bug #10402] * lib/uri/generic.rb (URI#query=): escape '[', '\', and ']'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/uri/generic.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/uri/generic.rb') diff --git a/lib/uri/generic.rb b/lib/uri/generic.rb index 03701aaf63..730230c205 100644 --- a/lib/uri/generic.rb +++ b/lib/uri/generic.rb @@ -851,7 +851,7 @@ module URI v.encode!(Encoding::UTF_8) rescue nil v.delete!("\t\r\n") v.force_encoding(Encoding::ASCII_8BIT) - v.gsub!(/(?!%\h\h|[!$-&(-;=?-_a-~])./n){'%%%02X' % $&.ord} + v.gsub!(/(?!%\h\h|[!$-&(-;=?-Z_a-~])./n.freeze){'%%%02X'.freeze % $&.ord} v.force_encoding(Encoding::US_ASCII) @query = v end -- cgit v1.2.3