Skip to content

Commit

Permalink
Merge pull request #31548 from nextcloud/backport/31531/stable22
Browse files Browse the repository at this point in the history
[stable22] Prevent reading key on SFTP stat bool
  • Loading branch information
blizzz authored Mar 16, 2022
2 parents c8f0d0b + 675e596 commit 85733a4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/files_external/lib/Lib/Storage/SFTP.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,9 @@ public function opendir($path) {
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';
}
Expand Down

0 comments on commit 85733a4

Please sign in to comment.