diff options
author | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-17 11:58:09 +0000 |
---|---|---|
committer | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-17 11:58:09 +0000 |
commit | 53127c2410c29f7cc942a76baa7be97ba65aafda (patch) | |
tree | 2216e7b11eb1b4b2d43602a3b4327122c225bcfb /lib | |
parent | 95d3671e94515fa83de975604fd1a03fa79f081b (diff) | |
download | ruby-53127c2410c29f7cc942a76baa7be97ba65aafda.tar.gz |
erb.rb: Don't encode tilde in #url_encode
Based on patch by madeofcode (Mark Dodwell).
[ruby-core:46168] [Bug #6696] [Fix GH-54]
`~` is a unreserved character.
https://tools.ietf.org/html/rfc3986#section-2.3
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/erb.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/erb.rb b/lib/erb.rb index ab65ef3be5..ae2bfd0091 100644 --- a/lib/erb.rb +++ b/lib/erb.rb @@ -994,7 +994,7 @@ class ERB # Programming%20Ruby%3A%20%20The%20Pragmatic%20Programmer%27s%20Guide # def url_encode(s) - s.to_s.b.gsub(/[^a-zA-Z0-9_\-.]/n) { |m| + s.to_s.b.gsub(/[^a-zA-Z0-9_\-.~]/n) { |m| sprintf("%%%02X", m.unpack("C")[0]) } end |