diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-03 00:33:47 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-03 00:33:47 +0000 |
commit | 21ab98a997d2ed44c9c95cf5434a42561b2cd688 (patch) | |
tree | 44ef7d98578082655bb1567b834547baf5756dc7 /lib/uri/generic.rb | |
parent | 167dd87d360b5f275a025b4464c19f20c5204b85 (diff) |
* 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
Diffstat (limited to 'lib/uri/generic.rb')
-rw-r--r-- | lib/uri/generic.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |