From 9a32672c2600b8b0414eae6527c6ed9263c1e2c7 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Fri, 21 Jan 2022 13:59:10 +0100 Subject: [PATCH] Fix accessing undefined offsets Move this to inside the else clause of the count($matches) Signed-off-by: Carl Schwan --- apps/files_external/lib/Lib/Backend/SMB.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/files_external/lib/Lib/Backend/SMB.php b/apps/files_external/lib/Lib/Backend/SMB.php index 57ee866f3c7..70eaa206483 100644 --- a/apps/files_external/lib/Lib/Backend/SMB.php +++ b/apps/files_external/lib/Lib/Backend/SMB.php @@ -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, -- 2.39.5