diff options
author | blizzz <blizzz@arthur-schiwon.de> | 2022-03-16 13:40:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-16 13:40:36 +0100 |
commit | 67f69269e2ac246c8d628c3ce317f2d612e26a5e (patch) | |
tree | b86ec789592905ca4a142962e56aa68607440511 | |
parent | 1be5725240e33fbd99cebc94ae1385171d80cada (diff) | |
parent | 0717c2f85cbfdf7fa7269a0d450baf922459a4f2 (diff) | |
download | nextcloud-server-67f69269e2ac246c8d628c3ce317f2d612e26a5e.tar.gz nextcloud-server-67f69269e2ac246c8d628c3ce317f2d612e26a5e.zip |
Merge pull request #31547 from nextcloud/backport/31531/stable23
[stable23] Prevent reading key on SFTP stat bool
-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'; } |