parent
1d7e0293a8
commit
10e526ba56
10 changed files with 27 additions and 15 deletions
|
|
@ -3,6 +3,7 @@ import type { UsersRepository } from '@/models/index.js';
|
|||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
||||
import { DI } from '@/di-symbols.js';
|
||||
import { UserEntityService } from '@/core/entities/UserEntityService.js';
|
||||
import { sqlLikeEscape } from '@/misc/sql-like-escape';
|
||||
|
||||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
|
@ -68,7 +69,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
|||
}
|
||||
|
||||
if (ps.username) {
|
||||
query.andWhere('user.usernameLower like :username', { username: ps.username.toLowerCase() + '%' });
|
||||
query.andWhere('user.usernameLower like :username', { username: sqlLikeEscape(ps.username.toLowerCase()) + '%' });
|
||||
}
|
||||
|
||||
if (ps.hostname) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue