diff --git a/cake/libs/http_socket.php b/cake/libs/http_socket.php index fce2f4899..59145f417 100644 --- a/cake/libs/http_socket.php +++ b/cake/libs/http_socket.php @@ -477,7 +477,23 @@ class HttpSocket extends CakeSocket { break; } - @list($chunkSize, $hexLength, $chunkExtensionName, $chunkExtensionValue) = $match; + $chunkSize = 0; + $hexLength = 0; + $chunkExtensionName = ''; + $chunkExtensionValue = ''; + if (isset($match[0])) { + $chunkSize = $match[0]; + } + if (isset($match[1])) { + $hexLength = $match[1]; + } + if (isset($match[2])) { + $chunkExtensionName = $match[2]; + } + if (isset($match[3])) { + $chunkExtensionValue = $match[3]; + } + $body = substr($body, strlen($chunkSize)); $chunkLength = hexdec($hexLength); $chunk = substr($body, 0, $chunkLength); @@ -846,10 +862,13 @@ class HttpSocket extends CakeSocket { list($name, $value) = explode('=', array_shift($parts)); $cookies[$name] = compact('value'); foreach ($parts as $part) { - @list($key, $value) = explode('=', $part); - if (is_null($value)) { + if (strpos($part, '=') !== false) { + list($key, $value) = explode('=', $part); + } else { + $key = $part; $value = true; } + $key = strtolower($key); if (!isset($cookies[$name][$key])) { $cookies[$name][$key] = $value; diff --git a/cake/libs/magic_db.php b/cake/libs/magic_db.php index bc47f4585..f0e5b3274 100644 --- a/cake/libs/magic_db.php +++ b/cake/libs/magic_db.php @@ -216,7 +216,22 @@ class MagicFileResource extends Object{ * @access public */ function test($magic) { - @list($offset, $type, $expected, $comment) = $magic; + $offset = null; + $type = null; + $expected = null; + $comment = null; + if (isset($magic[0])) { + $offset = $magic[0]; + } + if (isset($magic[1])) { + $type = $magic[1]; + } + if (isset($magic[2])) { + $expected = $magic[2]; + } + if (isset($magic[3])) { + $comment = $magic[3]; + } $val = $this->extract($offset, $type, $expected); return $val == $expected; } diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 9e5cae6da..340274082 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -2062,8 +2062,14 @@ class Model extends Overloadable { $prev = $next = null; - @list($prev) = $this->findAll(array_filter(array_merge($conditions, array($field => '< ' . $value))), $fields, $field . ' DESC', 1, null, 0); - @list($next) = $this->findAll(array_filter(array_merge($conditions, array($field => '> ' . $value))), $fields, $field . ' ASC', 1, null, 0); + $result = $this->findAll(array_filter(array_merge($conditions, array($field => '< ' . $value))), $fields, $field . ' DESC', 1, null, 0); + if (isset($result[0])) { + $prev = $result[0]; + } + $result = $this->findAll(array_filter(array_merge($conditions, array($field => '> ' . $value))), $fields, $field . ' ASC', 1, null, 0); + if (isset($result[0])) { + $next = $result[0]; + } return compact('prev', 'next'); } /**