Patch #39999 ยป 0001-Explicitly-render-a-404-on-non-JS-requests-to-messag.patch
| app/controllers/messages_controller.rb | ||
|---|---|---|
|
@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
|
||
| test/functional/messages_controller_test.rb | ||
|---|---|---|
|
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(
|
||