From 736b020a34a301e9fcc7c01083553ddc35317f86 Mon Sep 17 00:00:00 2001 From: DarkAngelBGE Date: Mon, 19 May 2008 20:25:42 +0000 Subject: [PATCH] removing error surpression operators, fixes #3877 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6968 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/http_socket.php | 25 ++++++++++++++++++++++--- cake/libs/magic_db.php | 17 ++++++++++++++++- cake/libs/model/model.php | 10 ++++++++-- 3 files changed, 46 insertions(+), 6 deletions(-) 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'); } /**