From: David Gageot Date: Fri, 5 Oct 2012 23:31:08 +0000 (+0200) Subject: SONAR-3765 backslash character '\' is duplicated on H2 X-Git-Tag: 3.3~95 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c0d0ca4a5f332de251f70b909673bbf91a9272ec;p=sonarqube.git SONAR-3765 backslash character '\' is duplicated on H2 --- 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