Commit d661b893c55577f1b781cf96c211765c4586b945

Authored by Riyad Preukschas
1 parent ce3fb949

Prevent gfm() to leak changes to the string supplied through the _text_ argument

Showing 1 changed file with 3 additions and 0 deletions   Show diff stats
lib/gitlab/markdown.rb
@@ -48,6 +48,9 @@ module Gitlab @@ -48,6 +48,9 @@ module Gitlab
48 def gfm(text, html_options = {}) 48 def gfm(text, html_options = {})
49 return text if text.nil? 49 return text if text.nil?
50 50
  51 + # prevents the string supplied through the _text_ argument to be altered
  52 + text = text.dup
  53 +
51 @html_options = html_options 54 @html_options = html_options
52 55
53 # Extract pre blocks so they are not altered 56 # Extract pre blocks so they are not altered