SFTP: size() isn't a method..

This commit is contained in:
terrafrost 2024-01-12 15:44:58 -06:00
parent 978a5d9dc0
commit 6b34da463c

View File

@ -2129,8 +2129,8 @@ class SFTP extends SSH2
$offset = $start; $offset = $start;
} elseif ($mode & (self::RESUME | self::RESUME_START)) { } elseif ($mode & (self::RESUME | self::RESUME_START)) {
// if NET_SFTP_OPEN_APPEND worked as it should _size() wouldn't need to be called // if NET_SFTP_OPEN_APPEND worked as it should _size() wouldn't need to be called
$size = $this->size($remote_file); $stat = $this->stat($remote_file);
$offset = $size !== false ? max($size, 0) : 0; $offset = $stat !== false && $stat['size'] ? $stat['size'] : 0;
} else { } else {
$offset = 0; $offset = 0;
if ($this->version >= 5) { if ($this->version >= 5) {