diff options
author | Git'Fellow <12234510+solracsf@users.noreply.github.com> | 2024-09-14 11:21:17 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2024-09-14 16:57:21 +0000 |
commit | 8a7cd1aefb6e2f4ea62715cf720254459356bbad (patch) | |
tree | 41dbb5362d71d77124c85f2f87e824c629b89aae /apps/files_external/lib | |
parent | b5347e89e78eab64d47ec844dfcd7c4ea1a0c153 (diff) | |
download | nextcloud-server-8a7cd1aefb6e2f4ea62715cf720254459356bbad.tar.gz nextcloud-server-8a7cd1aefb6e2f4ea62715cf720254459356bbad.zip |
fix(files_external): Check key exists before accessing it
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
Diffstat (limited to 'apps/files_external/lib')
-rw-r--r-- | apps/files_external/lib/Lib/Storage/SFTP.php | 12 |
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 6046b7266f5..120059c29ea 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; } |