From 6b34da463cba176825c7d834bd013a7540bd703c Mon Sep 17 00:00:00 2001 From: terrafrost Date: Fri, 12 Jan 2024 15:44:58 -0600 Subject: [PATCH] SFTP: size() isn't a method.. --- phpseclib/Net/SFTP.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index 2da1bcd9..4522e2b9 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -2129,8 +2129,8 @@ class SFTP extends SSH2 $offset = $start; } elseif ($mode & (self::RESUME | self::RESUME_START)) { // if NET_SFTP_OPEN_APPEND worked as it should _size() wouldn't need to be called - $size = $this->size($remote_file); - $offset = $size !== false ? max($size, 0) : 0; + $stat = $this->stat($remote_file); + $offset = $stat !== false && $stat['size'] ? $stat['size'] : 0; } else { $offset = 0; if ($this->version >= 5) {