Fix regex for allowed characters in user ID

was incorrectly banning # symbols
solves issues regarding SSO with Microsoft 365 accounts

Signed-off-by: kale1d0code <marty.the.mad@gmail.com>
This commit is contained in:
kale1d0code 2025-12-17 13:37:55 +00:00 committed by GitHub
parent 89fcefbfa0
commit eca9d75d0b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -694,8 +694,8 @@ class Manager extends PublicEmitter implements IUserManager {
$l = Server::get(IFactory::class)->get('lib');
// Check the ID for bad characters
// Allowed are: "a-z", "A-Z", "0-9", spaces and "_.@-'"
if (preg_match('/[^a-zA-Z0-9 _.@\-\']/', $uid)) {
// Allowed are: "a-z", "A-Z", "0-9", spaces and "_.@-'#"
if (preg_match(/[^a-zA-Z0-9 _.@\-'#]/, $uid)) {
throw new \InvalidArgumentException($l->t('Only the following characters are allowed in an Login:'
. ' "a-z", "A-Z", "0-9", spaces and "_.@-\'"'));
}