]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix accessing undefined offsets 30812/head
authorCarl Schwan <carl@carlschwan.eu>
Fri, 21 Jan 2022 12:59:10 +0000 (13:59 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Sat, 22 Jan 2022 09:01:12 +0000 (09:01 +0000)
Move this to inside the else clause of the count($matches)

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
apps/files_external/lib/Lib/Backend/SMB.php

index 57ee866f3c793b89dcc1b3fa6075245d4496b65c..70eaa2064833b6ce3a0920150bdde8a824fa8d5d 100644 (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,