Merge pull request #31548 from nextcloud/backport/31531/stable22

[stable22] Prevent reading key on SFTP stat bool
This commit is contained in:
blizzz 2022-03-16 13:07:55 +01:00 committed by GitHub
commit 85733a4b2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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';
}