Skip to content

Commit 67f6926

Browse files
authored
Merge pull request #31547 from nextcloud/backport/31531/stable23
[stable23] Prevent reading key on SFTP stat bool
2 parents 1be5725 + 0717c2f commit 67f6926

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • apps/files_external/lib/Lib/Storage

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)