Prevent reading key on SFTP stat bool

Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ 2022-03-11 10:54:52 +01:00
parent 23e8ae15aa
commit e81eaf45d2
No known key found for this signature in database
GPG key ID: 60C25B8C072916CF

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