diff options
author | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-03-01 15:43:25 +0300 |
---|---|---|
committer | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-05-02 20:11:50 +0300 |
commit | a114c988b4c17e37508f1d0f96b93fd8b96d2df9 (patch) | |
tree | 047062ccd14d568849c18a39590d72a2e132d1dc /app/finders/pipelines_finder.rb | |
parent | d15c120f72a375b6c9634e9aaeaeb159bb0c1998 (diff) |
Fixed SQL injection
Diffstat (limited to 'app/finders/pipelines_finder.rb')
-rw-r--r-- | app/finders/pipelines_finder.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/finders/pipelines_finder.rb b/app/finders/pipelines_finder.rb index 4a44a469a48..5408cc09096 100644 --- a/app/finders/pipelines_finder.rb +++ b/app/finders/pipelines_finder.rb @@ -103,9 +103,9 @@ class PipelinesFinder if params[:order_by].present? && params[:sort].present? && items.column_names.include?(params[:order_by]) && (params[:sort].casecmp('ASC') || params[:sort].casecmp('DESC')) - items.order("#{params[:order_by]} #{params[:sort]}") + items.reorder(params[:order_by] => params[:sort]) else - items.order(id: :desc) + items.reorder(id: :desc) end end end |