Commit e3fed8aaf4b2b9c3a7a0b719acd52408b1d4f90a

Authored by Valeriy Sizov
1 parent 00bc0e25

InlineDiff: fix bug "unmatched close parenthesis"

Showing 1 changed file with 2 additions and 3 deletions   Show diff stats
lib/gitlab/inline_diff.rb
... ... @@ -34,9 +34,8 @@ module Gitlab
34 34 end
35 35 last_the_same_symbols += 1
36 36 last_token = first_line[last_the_same_symbols..-1]
37   -
38   - diff_arr[index+1].sub!(/#{last_token}$/, FINISH + last_token)
39   - diff_arr[index+2].sub!(/#{last_token}$/, FINISH + last_token)
  37 + diff_arr[index+1].sub!(/#{Regexp.escape(last_token)}$/, FINISH + last_token)
  38 + diff_arr[index+2].sub!(/#{Regexp.escape(last_token)}$/, FINISH + last_token)
40 39 end
41 40 diff_arr
42 41 end
... ...