From d661b893c55577f1b781cf96c211765c4586b945 Mon Sep 17 00:00:00 2001 From: Riyad Preukschas Date: Sat, 8 Sep 2012 01:58:12 +0200 Subject: [PATCH] Prevent gfm() to leak changes to the string supplied through the _text_ argument --- lib/gitlab/markdown.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/gitlab/markdown.rb b/lib/gitlab/markdown.rb index f9125e0390a..4fc0c392cac 100644 --- a/lib/gitlab/markdown.rb +++ b/lib/gitlab/markdown.rb @@ -48,6 +48,9 @@ module Gitlab def gfm(text, html_options = {}) return text if text.nil? + # prevents the string supplied through the _text_ argument to be altered + text = text.dup + @html_options = html_options # Extract pre blocks so they are not altered