mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
Fixing call-time pass-by-ref errors in Behavior
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6533 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
e87d4e80dd
commit
ab7bf5a46c
1 changed files with 3 additions and 3 deletions
|
@ -153,7 +153,7 @@ class ModelBehavior extends Object {
|
|||
*/
|
||||
function dispatchMethod(&$model, $method, $params = array()) {
|
||||
if (empty($params)) {
|
||||
return $this->{$method}(&$model);
|
||||
return $this->{$method}($model);
|
||||
}
|
||||
$params = array_values($params);
|
||||
|
||||
|
@ -169,7 +169,7 @@ class ModelBehavior extends Object {
|
|||
case 5:
|
||||
return $this->{$method}($model, $params[0], $params[1], $params[2], $params[3], $params[4]);
|
||||
default:
|
||||
array_unshift($params, &$model);
|
||||
array_unshift($params, $model);
|
||||
return call_user_func_array(array(&$this, $method), $params);
|
||||
break;
|
||||
}
|
||||
|
@ -438,7 +438,7 @@ class BehaviorCollection extends Object {
|
|||
if (in_array($name, $this->_disabled)) {
|
||||
continue;
|
||||
}
|
||||
$result = $this->{$name}->dispatchMethod(&$model, $callback, $params);
|
||||
$result = $this->{$name}->dispatchMethod($model, $callback, $params);
|
||||
|
||||
if ($options['break'] && ($result === $options['breakOn'] || is_array($options['breakOn'] && in_array($result, $options['breakOn'], true)))) {
|
||||
return $result;
|
||||
|
|
Loading…
Add table
Reference in a new issue