Fix accessing undefined offsets

Move this to inside the else clause of the count($matches)

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
This commit is contained in:
Carl Schwan 2022-01-21 13:59:10 +01:00 committed by backportbot[bot]
parent 7acd13d002
commit 627466a226

View file

@ -108,14 +108,12 @@ class SMB extends Backend {
if (empty($realm)) {
$realm = 'WORKGROUP';
}
$userPart = $matches[1];
$domainPart = $matches[2];
if (count($matches) === 0) {
$username = $user;
$workgroup = $realm;
} else {
$username = $userPart;
$workgroup = $domainPart;
$username = $matches[1];;
$workgroup = $matches[2];
}
$smbAuth = new BasicAuth(
$username,