summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-03-01 21:43:25 +0900
committerShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-05-03 02:11:50 +0900
commita114c988b4c17e37508f1d0f96b93fd8b96d2df9 (patch)
tree047062ccd14d568849c18a39590d72a2e132d1dc /app
parentd15c120f72a375b6c9634e9aaeaeb159bb0c1998 (diff)
downloadgitlab-ce-a114c988b4c17e37508f1d0f96b93fd8b96d2df9.tar.gz
Fixed SQL injection
Diffstat (limited to 'app')
-rw-r--r--app/finders/pipelines_finder.rb4
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