summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-01-20 20:04:15 +0100
committerDouwe Maan <douwe@selenight.nl>2016-01-20 20:04:15 +0100
commit7d347ae564c137bd8b133dd4d589b089bde931a5 (patch)
tree2004517d9c80fbd95359d2bd53842fa031415a72 /lib
parent6000f8545f43b449035cb50382901ce40fb807b0 (diff)
parenta8a65afe1e953ce3a9fc151f9e033b99fc568fad (diff)
downloadgitlab-ce-7d347ae564c137bd8b133dd4d589b089bde931a5.tar.gz
Merge branch 'master' into issue_3945
Diffstat (limited to 'lib')
-rw-r--r--lib/banzai/filter/reference_filter.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/banzai/filter/reference_filter.rb b/lib/banzai/filter/reference_filter.rb
index 20bd4f7ee6e..3637b1bac94 100644
--- a/lib/banzai/filter/reference_filter.rb
+++ b/lib/banzai/filter/reference_filter.rb
@@ -133,6 +133,7 @@ module Banzai
next unless link && text
link = CGI.unescape(link)
+ next unless link.force_encoding('UTF-8').valid_encoding?
# Ignore ending punctionation like periods or commas
next unless link == text && text =~ /\A#{pattern}/
@@ -170,6 +171,7 @@ module Banzai
next unless link && text
link = CGI.unescape(link)
+ next unless link.force_encoding('UTF-8').valid_encoding?
next unless link && link =~ /\A#{pattern}\z/
html = yield link, text