aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2013-06-04 16:29:55 +0200
committerJulien Lancelot <julien.lancelot@gmail.com>2013-06-04 16:30:08 +0200
commite41ed396d6645c44252b3cfaa70c8d3920bf0ea4 (patch)
tree7c0716254faae398482ec877bfc63d8ec164785f /sonar-server/src
parentf8be252dc97b9f3bad23f319b1af48733b28e4f1 (diff)
downloadsonarqube-e41ed396d6645c44252b3cfaa70c8d3920bf0ea4.tar.gz
sonarqube-e41ed396d6645c44252b3cfaa70c8d3920bf0ea4.zip
Replace all space by '_' in key when creating manual rule
Diffstat (limited to 'sonar-server/src')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/rule.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/rule.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/rule.rb
index 7b425f0cbe4..a8bd6d19d37 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/models/rule.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/rule.rb
@@ -181,7 +181,7 @@ class Rule < ActiveRecord::Base
if Api::Utils.is_integer?(rule_id_or_name)
rule = Rule.first(:conditions => {:status => STATUS_READY, :plugin_name => MANUAL_REPOSITORY_KEY, :id => rule_id_or_name.to_i})
else
- key = rule_id_or_name.strip.downcase.sub(/\s+/, '_')
+ key = rule_id_or_name.strip.downcase.gsub(/\s/, '_')
rule = Rule.first(:conditions => {:status => STATUS_READY, :plugin_name => MANUAL_REPOSITORY_KEY, :plugin_rule_key => key})
if rule==nil && create_if_not_found
description = options[:description] || Api::Utils.message('manual_rules.should_provide_real_description')