Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarka Košanová <jarka@gitlab.com>2018-12-12 21:28:31 +0300
committerJarka Košanová <jarka@gitlab.com>2018-12-12 21:30:13 +0300
commita1d69ab6b86b93e600bdd90190f0a7d574992e91 (patch)
tree79a00ff01e735fdd5bb159d4ba59f79b04cfde5e /lib/banzai
parent7b1ea8cae2d43498f2eff02ead21977a90822ce1 (diff)
Escape html entities when no label found
Diffstat (limited to 'lib/banzai')
-rw-r--r--lib/banzai/filter/label_reference_filter.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/banzai/filter/label_reference_filter.rb b/lib/banzai/filter/label_reference_filter.rb
index 04ec38209c7..f90a35952e5 100644
--- a/lib/banzai/filter/label_reference_filter.rb
+++ b/lib/banzai/filter/label_reference_filter.rb
@@ -29,7 +29,7 @@ module Banzai
if label
yield match, label.id, project, namespace, $~
else
- match
+ escape_html_entities(match)
end
end
end
@@ -102,6 +102,10 @@ module Banzai
CGI.unescapeHTML(text.to_s)
end
+ def escape_html_entities(text)
+ CGI.escapeHTML(text.to_s)
+ end
+
def object_link_title(object, matches)
# use title of wrapped element instead
nil