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
This commit is contained in:
the_undefined 2008-05-09 17:55:14 +00:00
parent c6e1a59891
commit 9251801602
2 changed files with 5 additions and 4 deletions

View file

@ -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;

View file

@ -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;