Skip to content

Commit e81eaf4

Browse files
committed
Prevent reading key on SFTP stat bool
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
1 parent 23e8ae1 commit e81eaf4

File tree

1 file changed

+3
-0
lines changed
  • apps/files_external/lib/Lib/Storage

1 file changed

+3
-0
lines changed

apps/files_external/lib/Lib/Storage/SFTP.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,9 @@ public function opendir($path) {
327327
public function filetype($path) {
328328
try {
329329
$stat = $this->getConnection()->stat($this->absPath($path));
330+
if (!is_array($stat) || !array_key_exists('type', $stat)) {
331+
return false;
332+
}
330333
if ((int) $stat['type'] === NET_SFTP_TYPE_REGULAR) {
331334
return 'file';
332335
}

0 commit comments

Comments
 (0)