diff options
author | Jeremy Evans <[email protected]> | 2019-06-20 14:47:15 -0700 |
---|---|---|
committer | Jeremy Evans <[email protected]> | 2019-09-27 07:43:32 -0700 |
commit | a2c26fe1c6d49b54494b7c6301cc4c77596eec0c (patch) | |
tree | cda2f7e4a2fa87795a5f9aa41758bf72e37b12bf /lib/uri/common.rb | |
parent | 43a16c98df392e726040f0331a3e09d00c53d513 (diff) |
Fix fallback in URI.encode_www_form_component to include #
Patch from Matthew Kerwin.
Fixes [Bug #14358]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/2494
Diffstat (limited to 'lib/uri/common.rb')
-rw-r--r-- | lib/uri/common.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/uri/common.rb b/lib/uri/common.rb index 17d9ffc28c..811ec98aad 100644 --- a/lib/uri/common.rb +++ b/lib/uri/common.rb @@ -370,7 +370,7 @@ module URI if str.encoding != Encoding::ASCII_8BIT if enc && enc != Encoding::ASCII_8BIT str.encode!(Encoding::UTF_8, invalid: :replace, undef: :replace) - str.encode!(enc, fallback: ->(x){"&#{x.ord};"}) + str.encode!(enc, fallback: ->(x){"&##{x.ord};"}) end str.force_encoding(Encoding::ASCII_8BIT) end |