diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2022-03-11 12:54:52 +0300 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2022-03-11 18:11:34 +0300 |
commit | 675e596a00634c689c11b347a1d45d70865a2c4b (patch) | |
tree | 21195643a8c67bb18adfb1edd76b71d056479576 /apps/files_external | |
parent | 69d9c1d7c7a10b7a66f4444bb58c17f526039e31 (diff) |
Prevent reading key on SFTP stat boolbackport/31531/stable22
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files_external')
-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'; } |