forked from MarseyWorld/MarseyWorld
make mentioning case-insensitive again
parent
50135ce159
commit
c01d53aa0d
|
@ -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()
|
||||
|
||||
|
|
|
@ -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)}<a href="/id/{u.id}"><img loading="lazy" src="/pp/{u.id}">@{u.username}</a>''', 1)
|
||||
|
|
Loading…
Reference in New Issue