FIX: support non-english tags in tag input field

This commit is contained in:
Neil Lalonde
2017-07-07 14:48:08 -04:00
parent 6f09df0deb
commit a509146ea5
2 changed files with 16 additions and 2 deletions

View File

@@ -64,9 +64,8 @@ module DiscourseTagging
def self.filter_allowed_tags(query, guardian, opts={})
term = opts[:term]
if term.present?
term.downcase!
term.gsub!(/[^a-z0-9\.\-\_]*/, '')
term.gsub!("_", "\\_")
term = clean_tag(term)
query = query.where('tags.name like ?', "%#{term}%")
end