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:
@@ -813,7 +813,7 @@ class User < ApplicationRecord
|
||||
end
|
||||
|
||||
def search(params)
|
||||
q = where("true")
|
||||
q = super
|
||||
return q if params.blank?
|
||||
|
||||
if params[:name].present?
|
||||
@@ -836,10 +836,6 @@ class User < ApplicationRecord
|
||||
q = q.where("level = ?", params[:level].to_i)
|
||||
end
|
||||
|
||||
if params[:id].present?
|
||||
q = q.where("id in (?)", params[:id].split(",").map(&:to_i))
|
||||
end
|
||||
|
||||
bitprefs_length = BOOLEAN_ATTRIBUTES.length
|
||||
bitprefs_include = nil
|
||||
bitprefs_exclude = nil
|
||||
|
||||
Reference in New Issue
Block a user