]> source.dussan.org Git - redmine.git/commitdiff
Fixed flawed regexp for removing pre blocks when quoting notes (#16353).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 15 Mar 2014 10:36:56 +0000 (10:36 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 15 Mar 2014 10:36:56 +0000 (10:36 +0000)
Patch by Stephane Lapie.

git-svn-id: http://svn.redmine.org/redmine/trunk@12969 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/journals_controller.rb

index fc4edae2104e77dec4a8c74ca9979708fe175a41..fe1c01907da40b6f23ed4c8f801559f8f9e2a4f7 100644 (file)
@@ -66,7 +66,7 @@ class JournalsController < ApplicationController
       text = @issue.description
     end
     # Replaces pre blocks with [...]
-    text = text.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]')
+    text = text.to_s.strip.gsub(%r{<pre>(.*?)</pre>}m, '[...]')
     @content = "#{ll(Setting.default_language, :text_user_wrote, user)}\n> "
     @content << text.gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
   rescue ActiveRecord::RecordNotFound