We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3fcead commit c9271a8Copy full SHA for c9271a8
src/Connection/Protocols/ImapProtocol.php
@@ -110,15 +110,12 @@ protected function enableStartTls(){
110
* @throws RuntimeException
111
*/
112
public function nextLine(): string {
113
- $line = "";
114
- while (($next_char = fread($this->stream, 1)) !== false && $next_char !== "\n") {
115
- $line .= $next_char;
+ $line = fgets($this->stream);
+ if ($line === false) {
+ throw new RuntimeException('no response');
116
}
117
- if ($line === "" && $next_char === false) {
118
- throw new RuntimeException('empty response');
119
- }
120
- if ($this->debug) echo "<< ".$line."\n";
121
- return $line . "\n";
+ if ($this->debug) echo "<< ".$line;
+ return $line;
122
123
124
/**
0 commit comments