更改:防止sql注入
This commit is contained in:
parent
21f559f254
commit
26461f3a44
|
@ -25,11 +25,11 @@ class Admins::ProjectsRankController < Admins::BaseController
|
|||
end
|
||||
|
||||
def sort_by
|
||||
params.fetch(:sort_by, "score")
|
||||
DailyProjectStatistic.column_names.include?(params.fetch(:sort_by, "score")) ? params.fetch(:sort_by, "score") : "score"
|
||||
end
|
||||
|
||||
def sort_direction
|
||||
params.fetch(:sort_direction, "desc")
|
||||
%w(desc asc).include?(params.fetch(:sort_direction, "desc")) ? params.fetch(:sort_direction, "desc") : "desc"
|
||||
end
|
||||
|
||||
def export_excel(data)
|
||||
|
|
Loading…
Reference in New Issue