Fix #3430: Accept the search[id] param in all controllers.
* Allow every controller to take the `search[id]` param. * Parse the `search[id]` param the same way that the `id:<N>` metatag is parsed. So `search[id]=1,2,3`, `search[id]=<42`, `search[id]=1..10`, for example, are all accepted.
This commit is contained in:
@@ -73,11 +73,8 @@ class ForumTopic < ApplicationRecord
|
||||
end
|
||||
|
||||
def search(params)
|
||||
q = permitted
|
||||
|
||||
if params[:id].present?
|
||||
q = q.where(id: params[:id].split(",").map(&:to_i))
|
||||
end
|
||||
q = super
|
||||
q = q.permitted
|
||||
|
||||
if params[:mod_only].present?
|
||||
q = q.where("min_level >= ?", MIN_LEVELS[:Moderator])
|
||||
|
||||
Reference in New Issue
Block a user