summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Lee <huacnlee@gmail.com>2016-01-12 17:05:43 +0800
committerJason Lee <huacnlee@gmail.com>2016-01-12 18:19:55 +0800
commit41bcab118ae8be1baee0d750d99f46f584bd2fd4 (patch)
tree317269ebef7a786e0e0a6c13f1c9a9380bd5ed91
parentc4511a123401dcf9c2e1b3de732d18463fe9ba90 (diff)
downloadgitlab-ce-41bcab118ae8be1baee0d750d99f46f584bd2fd4.tar.gz
Fix #9963 reference_filter "Encoding::CompatibilityError" bug with some complex URL;
-rw-r--r--lib/banzai/filter/reference_filter.rb4
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