diff options
author | David Gageot <david@gageot.net> | 2012-10-06 01:31:08 +0200 |
---|---|---|
committer | David Gageot <david@gageot.net> | 2012-10-06 01:32:43 +0200 |
commit | c0d0ca4a5f332de251f70b909673bbf91a9272ec (patch) | |
tree | 8db9f43b2b2497b8665a0b5e6893c72f3fab8a4d /sonar-server | |
parent | 41385f9afe231f539ae90d1af63e9ad7e792eb99 (diff) | |
download | sonarqube-c0d0ca4a5f332de251f70b909673bbf91a9272ec.tar.gz sonarqube-c0d0ca4a5f332de251f70b909673bbf91a9272ec.zip |
SONAR-3765 backslash character '\' is duplicated on H2
Diffstat (limited to 'sonar-server')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/config/initializers/better_quoting.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/config/initializers/better_quoting.rb b/sonar-server/src/main/webapp/WEB-INF/config/initializers/better_quoting.rb new file mode 100644 index 00000000000..60071f649ca --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/config/initializers/better_quoting.rb @@ -0,0 +1,14 @@ +# Override quoting for database without a specific jdbc adapter +# for example, H2 +# +# Default quoting leads to bugs, see SONAR-3765 +# +module ActiveRecord + module ConnectionAdapters # :nodoc: + module Quoting + def quote_string(s) + s.gsub(/'/, "''") # ' (for ruby-mode) + end + end + end +end |