diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-01-20 15:26:44 +0100 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-01-20 15:26:44 +0100 |
commit | a010db5db243a532cb8d1c2d5ac787e90da0044f (patch) | |
tree | aa7ab255b019bbd5412c34315118616a3a86f81a /lib/gitlab/diff/parser.rb | |
parent | 88bd13851300b98c9d0290cfac5ad1f14673b34d (diff) | |
download | gitlab-ce-a010db5db243a532cb8d1c2d5ac787e90da0044f.tar.gz |
Properly handle HTML entities with inline diffs
Diffstat (limited to 'lib/gitlab/diff/parser.rb')
-rw-r--r-- | lib/gitlab/diff/parser.rb | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/gitlab/diff/parser.rb b/lib/gitlab/diff/parser.rb index 2c0a866e8ba..6c8a1fc6d6f 100644 --- a/lib/gitlab/diff/parser.rb +++ b/lib/gitlab/diff/parser.rb @@ -14,7 +14,7 @@ module Gitlab @lines.each do |line| next if filename?(line) - full_line = html_escape(line.gsub(/\n/, '')) + full_line = line.gsub(/\n/, '') if line.match(/^@@ -/) type = "match" @@ -67,11 +67,6 @@ module Gitlab nil end end - - def html_escape(str) - replacements = { '&' => '&', '>' => '>', '<' => '<', '"' => '"', "'" => ''' } - str.gsub(/[&"'><]/, replacements) - end end end end |