Skip to content

Commit

Permalink
fix PHP 8.0 ValueError: fread(): Argument #2 ($length) must be greate…
Browse files Browse the repository at this point in the history
…r than 0
  • Loading branch information
ralfbecker authored and Ralf Lang committed Oct 25, 2023
1 parent c595cef commit df60c39
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/Horde/Stream/Wrapper/Combine.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,11 @@ public function stream_read($count)
}

$curr_read = min($count, $tmp['l'] - $tmp['p']);
$out .= fread($tmp['fp'], $curr_read);
$count -= $curr_read;
$this->_position += $curr_read;
if ($curr_read > 0) {
$out .= fread($tmp['fp'], $curr_read);
$count -= $curr_read;
$this->_position += $curr_read;
}

if ($this->_position == $this->_length) {
if ($count) {
Expand Down

0 comments on commit df60c39

Please sign in to comment.