Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-03-01 15:43:25 +0300
committerShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-05-02 20:11:50 +0300
commita114c988b4c17e37508f1d0f96b93fd8b96d2df9 (patch)
tree047062ccd14d568849c18a39590d72a2e132d1dc /app/finders
parentd15c120f72a375b6c9634e9aaeaeb159bb0c1998 (diff)
Fixed SQL injection
Diffstat (limited to 'app/finders')
-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