Skip to content

Commit f0643d0

Browse files
Merge cc016b9 into 45843e1
2 parents 45843e1 + cc016b9 commit f0643d0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Connection/Protocols/ImapProtocol.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ protected function enableStartTls(){
105105
*/
106106
public function nextLine(): string {
107107
$line = "";
108-
while (($next_char = fread($this->stream, 1)) !== false && $next_char !== "\n") {
108+
while (($next_char = fread($this->stream, 1)) !== false && !in_array($next_char, ["","\n"])) {
109109
$line .= $next_char;
110110
}
111111
if ($line === "" && $next_char === false) {
@@ -137,7 +137,7 @@ protected function nextTaggedLine(&$tag): string {
137137
$line = $this->nextLine();
138138
list($tag, $line) = explode(' ', $line, 2);
139139

140-
return $line;
140+
return $line ?? '';
141141
}
142142

143143
/**

0 commit comments

Comments
 (0)