make blacklist validation case insensitive

This commit is contained in:
ghost 2023-12-18 06:17:49 +02:00
parent 0e9e83a83f
commit bc5307bc2c

View File

@ -262,7 +262,7 @@ class UserController extends AbstractController
}
// Validate username blacklist (reserved)
if (in_array($username, (array) explode('|', $this->getParameter('app.add.user.name.blacklist'))))
if (in_array(mb_strtolower($username), array_map('mb_strtolower', (array) explode('|', $this->getParameter('app.add.user.name.blacklist')))))
{
return $this->redirectToRoute(
'user_add',
@ -498,7 +498,7 @@ class UserController extends AbstractController
}
// Validate username blacklist
if (in_array($username, (array) explode('|', $this->getParameter('app.add.user.name.blacklist'))))
if (in_array(mb_strtolower($username), array_map('mb_strtolower', (array) explode('|', $this->getParameter('app.add.user.name.blacklist')))))
{
return $this->redirectToRoute(
'user_login',