Project

General

Profile

Feature #35073 » 0005-sanitize_sql_for_conditions-is-now-public.patch

Jens Krämer, 2021-04-12 08:44

View differences:

app/models/query.rb
1430 1430
    suffix = '%' if options[:starts_with]
1431 1431
    prefix = suffix = '%' if prefix.nil? && suffix.nil?
1432 1432
    value = queried_class.sanitize_sql_like value
1433
    queried_class.send(
1434
      :sanitize_sql_for_conditions,
1435
      [Redmine::Database.like(db_field, '?', :match => options[:match]), "#{prefix}#{value}#{suffix}"])
1433
    queried_class.sanitize_sql_for_conditions([
1434
      Redmine::Database.like(db_field, '?', :match => options[:match]),
1435
      "#{prefix}#{value}#{suffix}"
1436
    ])
1436 1437
  end
1437 1438

  
1438 1439
  # Adds a filter for the given custom field
(1-1/8)