mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 18:58:10 +00:00
FIX: tag search should not be case sensitive
This commit is contained in:
parent
e78b7a243e
commit
b381d84dd9
@ -77,7 +77,7 @@ export default Ember.TextField.extend({
|
||||
callback(data);
|
||||
},
|
||||
createSearchChoice: function(term, data) {
|
||||
term = term.replace(filterRegexp, '').trim();
|
||||
term = term.replace(filterRegexp, '').trim().toLowerCase();
|
||||
|
||||
// No empty terms, make sure the user has permission to create the tag
|
||||
if (!term.length || !self.get('allowCreate') || self.get('termMatchesForbidden')) return;
|
||||
|
@ -56,6 +56,7 @@ 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!("_", "\\_")
|
||||
query = query.where('tags.name like ?', "%#{term}%")
|
||||
|
Loading…
x
Reference in New Issue
Block a user