diff --git a/cake/libs/http_socket.php b/cake/libs/http_socket.php index 52ec9d1b9..fce2f4899 100644 --- a/cake/libs/http_socket.php +++ b/cake/libs/http_socket.php @@ -469,7 +469,7 @@ class HttpSocket extends CakeSocket { $chunkLength = null; while ($chunkLength !== 0) { - if (!preg_match("/^([0-9a-f]+)(?:;(.+)=(.+))?\r\n/iU", $body, $match)) { + if (!preg_match("/^([0-9a-f]+) *(?:;(.+)=(.+))?\r\n/iU", $body, $match)) { if (!$this->quirksMode) { trigger_error(__('HttpSocket::decodeChunkedBody - Could not parse malformed chunk. Activate quirks mode to do this.', true), E_USER_WARNING); return false; diff --git a/cake/libs/socket.php b/cake/libs/socket.php index a5f861406..625176920 100644 --- a/cake/libs/socket.php +++ b/cake/libs/socket.php @@ -266,15 +266,16 @@ class CakeSocket extends Object { * @return boolean True on success * @access public */ - function reset($initialState = null) { - if (empty($initalState)) { + function reset($state = null) { + if (empty($state)) { static $initalState = array(); if (empty($initalState)) { $initalState = get_class_vars(__CLASS__); } + $state = $initalState; } - foreach ($initalState as $property => $value) { + foreach ($state as $property => $value) { $this->{$property} = $value; } return true;