mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 15:28:30 +08:00
FIX: Don't error out on nested topic show id param (#29274)
We're expecting the ID param to be something that neatly coerces into an ID. If we receive something like a nested parameter, this will blow up. (We already handle the case of arrays.) This commit raises an InvalidParameters exception in the case of a nested ID.
This commit is contained in:
@ -51,7 +51,7 @@ class TopicsController < ApplicationController
|
||||
end
|
||||
|
||||
def show
|
||||
if params[:id].is_a?(Array)
|
||||
if params[:id].is_a?(Array) || params[:id].is_a?(ActionController::Parameters)
|
||||
raise Discourse::InvalidParameters.new("Show only accepts a single ID")
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user