From 9251801602b9230d31ab76b8eea360a5d8d0d0b5 Mon Sep 17 00:00:00 2001 From: the_undefined Date: Fri, 9 May 2008 17:55:14 +0000 Subject: [PATCH] Fixed problem with Socket::reset Fixed bad conflict resolution in HttpSocket git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6780 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/http_socket.php | 2 +- cake/libs/socket.php | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) 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;