summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2024-01-03 01:20:47 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2024-01-03 01:20:47 +0000
commit8b0a4fb197906c61788734037240a25817c8ec5d (patch)
tree851566c05e390d6ef67101585b70dd5c17466d1c
parentdde4d143d18b6a8e5868caec6886c7ce8f95479b (diff)
downloadredmine-8b0a4fb197906c61788734037240a25817c8ec5d.tar.gz
redmine-8b0a4fb197906c61788734037240a25817c8ec5d.zip
Merge r22584 from trunk to 5.1-stable (#39999).
git-svn-id: https://svn.redmine.org/redmine/branches/5.1-stable@22585 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/controllers/messages_controller.rb5
-rw-r--r--test/functional/messages_controller_test.rb13
2 files changed, 18 insertions, 0 deletions
diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb
index b41830b85..a4b4478a2 100644
--- a/app/controllers/messages_controller.rb
+++ b/app/controllers/messages_controller.rb
@@ -125,6 +125,11 @@ class MessagesController < ApplicationController
@content = +"#{ll(Setting.default_language, :text_user_wrote_in, {:value => @message.author, :link => "message##{@message.id}"})}\n> "
end
@content << @message.content.to_s.strip.gsub(%r{<pre>(.*?)</pre>}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
+
+ respond_to do |format|
+ format.html { render_404 }
+ format.js
+ end
end
def preview
diff --git a/test/functional/messages_controller_test.rb b/test/functional/messages_controller_test.rb
index 2535e570b..4e146e4e6 100644
--- a/test/functional/messages_controller_test.rb
+++ b/test/functional/messages_controller_test.rb
@@ -311,6 +311,19 @@ class MessagesControllerTest < Redmine::ControllerTest
assert_include '> An other reply', response.body
end
+ def test_quote_as_html_should_respond_with_404
+ @request.session[:user_id] = 2
+ get(
+ :quote,
+ :params => {
+ :board_id => 1,
+ :id => 3
+ },
+ )
+
+ assert_response 404
+ end
+
def test_preview_new
@request.session[:user_id] = 2
post(