Skip to content

Commit

Permalink
Prevent reading key on SFTP stat bool
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv authored and backportbot[bot] committed Mar 11, 2022
1 parent 69d9c1d commit 675e596
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 675e596

Please sign in to comment.