diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2022-03-11 10:54:52 +0100 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2022-03-11 15:06:45 +0000 |
commit | 0717c2f85cbfdf7fa7269a0d450baf922459a4f2 (patch) | |
tree | 57044ec77f5bb4675cb46e7430bbac9804c00dcf | |
parent | 0d3c19c6aa76c7479fbb4b3784ae20b5b7b7ed89 (diff) | |
download | nextcloud-server-0717c2f85cbfdf7fa7269a0d450baf922459a4f2.tar.gz nextcloud-server-0717c2f85cbfdf7fa7269a0d450baf922459a4f2.zip |
Prevent reading key on SFTP stat bool
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
-rw-r--r-- | apps/files_external/lib/Lib/Storage/SFTP.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/files_external/lib/Lib/Storage/SFTP.php b/apps/files_external/lib/Lib/Storage/SFTP.php index ae049007cdc..e46f60d0be4 100644 --- a/apps/files_external/lib/Lib/Storage/SFTP.php +++ b/apps/files_external/lib/Lib/Storage/SFTP.php @@ -327,6 +327,9 @@ class SFTP extends \OC\Files\Storage\Common { public function filetype($path) { try { $stat = $this->getConnection()->stat($this->absPath($path)); + if (!is_array($stat) || !array_key_exists('type', $stat)) { + return false; + } if ((int) $stat['type'] === NET_SFTP_TYPE_REGULAR) { return 'file'; } |