From: Jean-Philippe Lang Date: Sat, 15 Mar 2014 10:36:56 +0000 (+0000) Subject: Fixed flawed regexp for removing pre blocks when quoting notes (#16353). X-Git-Tag: 2.6.0~277 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=995ae083cd53696297d6adecf5a209d736ab4166;p=redmine.git Fixed flawed regexp for removing pre blocks when quoting notes (#16353). Patch by Stephane Lapie. git-svn-id: http://svn.redmine.org/redmine/trunk@12969 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/controllers/journals_controller.rb b/app/controllers/journals_controller.rb index fc4edae21..fe1c01907 100644 --- a/app/controllers/journals_controller.rb +++ b/app/controllers/journals_controller.rb @@ -66,7 +66,7 @@ class JournalsController < ApplicationController text = @issue.description end # Replaces pre blocks with [...] - text = text.to_s.strip.gsub(%r{
((.|\s)*?)
}m, '[...]') + text = text.to_s.strip.gsub(%r{
(.*?)
}m, '[...]') @content = "#{ll(Setting.default_language, :text_user_wrote, user)}\n> " @content << text.gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n" rescue ActiveRecord::RecordNotFound