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:
authorJosé Iván Vargas López <jvargas@gitlab.com>2018-08-28 18:47:58 +0300
committerJosé Iván Vargas López <jvargas@gitlab.com>2018-08-28 18:47:58 +0300
commitaa73b3e19b740ec779780e9e7a0528fc9e20e8ee (patch)
treed0ffe9eeecd3e4b45354171579423f2b0d95f8a1 /lib/gitlab
parent81a403f05f05f4ee8d65db6185cbd0856f7c5189 (diff)
parent0d01ac51419cd429bd0ca02e42085e73db9ba713 (diff)
Merge branch 'security-diff-cache-fix-master' into 'security-49085-persistent-xss-rendering'
[master] Include rich_text in diff cache keys See merge request gitlab/gitlabhq!2481
Diffstat (limited to 'lib/gitlab')
-rw-r--r--lib/gitlab/diff/line.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/gitlab/diff/line.rb b/lib/gitlab/diff/line.rb
index 633985d5caa..1ab6df0b6ae 100644
--- a/lib/gitlab/diff/line.rb
+++ b/lib/gitlab/diff/line.rb
@@ -1,16 +1,17 @@
module Gitlab
module Diff
class Line
- SERIALIZE_KEYS = %i(line_code text type index old_pos new_pos).freeze
+ SERIALIZE_KEYS = %i(line_code rich_text text type index old_pos new_pos).freeze
attr_reader :line_code, :type, :index, :old_pos, :new_pos
attr_writer :rich_text
attr_accessor :text
- def initialize(text, type, index, old_pos, new_pos, parent_file: nil, line_code: nil)
+ def initialize(text, type, index, old_pos, new_pos, parent_file: nil, line_code: nil, rich_text: nil)
@text, @type, @index = text, type, index
@old_pos, @new_pos = old_pos, new_pos
@parent_file = parent_file
+ @rich_text = rich_text
# When line code is not provided from cache store we build it
# using the parent_file(Diff::File or Conflict::File).
@@ -18,7 +19,7 @@ module Gitlab
end
def self.init_from_hash(hash)
- new(hash[:text], hash[:type], hash[:index], hash[:old_pos], hash[:new_pos], line_code: hash[:line_code])
+ new(hash[:text], hash[:type], hash[:index], hash[:old_pos], hash[:new_pos], line_code: hash[:line_code], rich_text: hash[:rich_text])
end
def to_hash