]> source.dussan.org Git - redmine.git/commitdiff
SQL server: non ASCII filter on issue subject does not work (#22405).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 24 Apr 2016 10:57:15 +0000 (10:57 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 24 Apr 2016 10:57:15 +0000 (10:57 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@15351 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/query.rb

index d0a54d6c689e4a59e87739ea9da2848d799001c9..104b14e89a22f5235e7cf9071c1bdfe2ab9dba92 100644 (file)
@@ -909,8 +909,8 @@ class Query < ActiveRecord::Base
 
   # Returns a SQL LIKE statement with wildcards
   def sql_contains(db_field, value, match=true)
-    value = "'%#{self.class.connection.quote_string(value.to_s)}%'"
-    Redmine::Database.like(db_field, value, :match => match)
+    queried_class.send :sanitize_sql_for_conditions,
+      [Redmine::Database.like(db_field, '?', :match => match), "%#{value}%"]
   end
 
   # Adds a filter for the given custom field