diff options
author | Jason Lee <huacnlee@gmail.com> | 2016-01-12 17:05:43 +0800 |
---|---|---|
committer | Jason Lee <huacnlee@gmail.com> | 2016-01-12 18:19:55 +0800 |
commit | 41bcab118ae8be1baee0d750d99f46f584bd2fd4 (patch) | |
tree | 317269ebef7a786e0e0a6c13f1c9a9380bd5ed91 /lib/banzai | |
parent | c4511a123401dcf9c2e1b3de732d18463fe9ba90 (diff) | |
download | gitlab-ce-41bcab118ae8be1baee0d750d99f46f584bd2fd4.tar.gz |
Fix #9963 reference_filter "Encoding::CompatibilityError" bug with some complex URL;
Diffstat (limited to 'lib/banzai')
-rw-r--r-- | lib/banzai/filter/reference_filter.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/banzai/filter/reference_filter.rb b/lib/banzai/filter/reference_filter.rb index 7198a8b03e2..5dd6d2fe3c7 100644 --- a/lib/banzai/filter/reference_filter.rb +++ b/lib/banzai/filter/reference_filter.rb @@ -133,7 +133,7 @@ module Banzai next unless link && text - link = URI.decode(link) + link = CGI.unescape(link) # Ignore ending punctionation like periods or commas next unless link == text && text =~ /\A#{pattern}/ @@ -170,7 +170,7 @@ module Banzai text = node.text next unless link && text - link = URI.decode(link) + link = CGI.unescape(link) next unless link && link =~ /\A#{pattern}\z/ html = yield link, text |