From 7704efdb282cf7742a93f002fec561f2ad58196e Mon Sep 17 00:00:00 2001 From: Richard van den Berg Date: Thu, 19 Mar 2015 09:03:26 +0100 Subject: [PATCH] Use feof() in while loop --- lib/Cake/Network/CakeSocket.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Network/CakeSocket.php b/lib/Cake/Network/CakeSocket.php index 01e074589..8b134a9f3 100644 --- a/lib/Cake/Network/CakeSocket.php +++ b/lib/Cake/Network/CakeSocket.php @@ -177,9 +177,9 @@ class CakeSocket { $req[] = 'Host: ' . $this->config['host']; $req[] = 'User-Agent: php proxy'; - fwrite($this->connection, implode("\r\n", $req)."\r\n\r\n"); + fwrite($this->connection, implode("\r\n", $req) . "\r\n\r\n"); - while(true) { + while (!feof($this->connection)) { $s = rtrim(fgets($this->connection, 4096)); if (preg_match('/^$/', $s)) { break;