mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
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
This commit is contained in:
parent
47d3a8123b
commit
736b020a34
3 changed files with 46 additions and 6 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue