Prevent reading key on SFTP stat bool

Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
pull/31549/head
John Molakvoæ 2022-03-11 10:54:52 +07:00 committed by backportbot[bot]
parent 306b3ebb88
commit b770ba1157
1 changed files with 3 additions and 0 deletions

@ -328,6 +328,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';
}