Browse Source

make blacklist validation case insensitive

main
ghost 11 months ago
parent
commit
bc5307bc2c
  1. 4
      src/Controller/UserController.php

4
src/Controller/UserController.php

@ -262,7 +262,7 @@ class UserController extends AbstractController
} }
// Validate username blacklist (reserved) // 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( return $this->redirectToRoute(
'user_add', 'user_add',
@ -498,7 +498,7 @@ class UserController extends AbstractController
} }
// Validate username blacklist // 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( return $this->redirectToRoute(
'user_login', 'user_login',

Loading…
Cancel
Save