aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/Lib
diff options
context:
space:
mode:
authorGit'Fellow <12234510+solracsf@users.noreply.github.com>2024-09-14 11:21:17 +0200
committerGitHub <noreply@github.com>2024-09-14 11:21:17 +0200
commit07a6fd11d0b68bd35288180cf8aa33c85c5f1d18 (patch)
treecec2631a7524915cfc0ef0f607fd1c5216b5b24f /apps/files_external/lib/Lib
parenta751ff7b93039b9e24e6a29fec50482dd07f7dbf (diff)
downloadnextcloud-server-07a6fd11d0b68bd35288180cf8aa33c85c5f1d18.tar.gz
nextcloud-server-07a6fd11d0b68bd35288180cf8aa33c85c5f1d18.zip
fix(files_external): Check key exists before accessing itfixKeyExFileExt
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
Diffstat (limited to 'apps/files_external/lib/Lib')
-rw-r--r--apps/files_external/lib/Lib/Storage/SFTP.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/files_external/lib/Lib/Storage/SFTP.php b/apps/files_external/lib/Lib/Storage/SFTP.php
index 1fb6dec671d..acc531341d9 100644
--- a/apps/files_external/lib/Lib/Storage/SFTP.php
+++ b/apps/files_external/lib/Lib/Storage/SFTP.php
@@ -441,10 +441,14 @@ class SFTP extends Common {
try {
$stat = $this->getConnection()->stat($this->absPath($path));
- $mtime = $stat ? (int)$stat['mtime'] : -1;
- $size = $stat ? (int)$stat['size'] : 0;
-
- return ['mtime' => $mtime, 'size' => $size, 'ctime' => -1];
+ $mtime = isset($stat['mtime']) ? (int)$stat['mtime'] : -1;
+ $size = isset($stat['size']) ? (int)$stat['size'] : 0;
+
+ return [
+ 'mtime' => $mtime,
+ 'size' => $size,
+ 'ctime' => -1
+ ];
} catch (\Exception $e) {
return false;
}