diff --git a/files/helpers/get.py b/files/helpers/get.py index 3a9ee539c..8ade6c30a 100644 --- a/files/helpers/get.py +++ b/files/helpers/get.py @@ -75,8 +75,8 @@ def get_users(usernames, v=None, graceful=False): users = g.db.query(User).filter( or_( - User.username == any_(usernames), - User.original_username == any_(usernames) + User.username.ilike(any_(usernames)), + User.original_username.ilike(any_(usernames)) ) ).all() diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 638c51062..7f7d3bc82 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -201,7 +201,7 @@ def sanitize(sanitized, alert=False, edit=False): for u in users: if not u: continue - m = [ m for m in matches if u.username == m.group(2) or u.original_username == m.group(2) ] + m = [ m for m in matches if u.username.lower() == m.group(2).lower() or u.original_username.lower() == m.group(2).lower() ] for i in m: if not (g.v and g.v.any_block_exists(u)) or g.v.admin_level > 1: sanitized = sanitized.replace(i.group(0), f'''{i.group(1)}@{u.username}''', 1)