Skip to content

Commit

Permalink
Fix return value of handlePartBody() when using file handle
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Jul 8, 2024
1 parent d03154f commit 23fe16d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions program/lib/Roundcube/rcube_imap_generic.php
Original file line number Diff line number Diff line change
Expand Up @@ -2959,7 +2959,7 @@ public function handlePartBody($mailbox, $id, $is_uid = false, $part = '', $enco
$chunk = $this->decodeContent($chunk, $mode, $bytes <= 0, $prev);

if ($file) {
if (fwrite($file, $chunk) === false) {
if (($result = fwrite($file, $chunk)) === false) {
break;
}
} elseif ($print) {
Expand All @@ -2974,7 +2974,7 @@ public function handlePartBody($mailbox, $id, $is_uid = false, $part = '', $enco

if ($result !== false) {
if ($file) {
return fwrite($file, $result);
return is_string($result) ? fwrite($file, $result) !== false : true;
}

if ($print) {
Expand Down

0 comments on commit 23fe16d

Please sign in to comment.