From: Julien Lancelot Date: Fri, 10 Oct 2014 12:18:00 +0000 (+0200) Subject: SONAR-5198 search box with '_' (underscore) does not display expected results when... X-Git-Tag: 4.5.1-RC1~44 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=631ce5d6a76693d672791977810f19405f187153;p=sonarqube.git SONAR-5198 search box with '_' (underscore) does not display expected results when oracle DB is used --- 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)