Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-01-21 15:59:10 +0300
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2022-01-22 11:58:20 +0300
commitfc3b256dda4b8aeb0a4534f1cf0421f298ce3a12 (patch)
tree4162ec76ac69745537ced951692d89219c3c9d7a
parent8cb7adc131ce9d0b123d2c4418fb7fbfd3ca5631 (diff)
Fix accessing undefined offsets
Move this to inside the else clause of the count($matches) Signed-off-by: Carl Schwan <carl@carlschwan.eu>
-rw-r--r--apps/files_external/lib/Lib/Backend/SMB.php6
1 files 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,