From 631ce5d6a76693d672791977810f19405f187153 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Fri, 10 Oct 2014 14:18:00 +0200 Subject: [PATCH] SONAR-5198 search box with '_' (underscore) does not display expected results when oracle DB is used --- .../WEB-INF/app/controllers/api/components_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/components_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/components_controller.rb index a080bc1881d..410d59f601f 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/components_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/components_controller.rb @@ -27,9 +27,13 @@ class Api::ComponentsController < Api::ApiController search = params[:s] bad_request("Minimum search is #{ResourceIndex::MIN_SEARCH_SIZE} characters") if search.empty? || search.to_s.size 'distinct(resource_id),root_project_id,qualifier,name_size', # optimization to not load unused columns like 'kee' - :conditions => ['kee like ?', key + '%'], + :conditions => ['kee like ? ' + additional_escape, key + '%'], :order => 'name_size') results = select_authorized(:user, results) -- 2.39.5