mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
Fix to resolve 'assign by reference' errors when using a '__get' magic method.
Fixes #1476 Signed-off-by: mark_story <mark@mark-story.com>
This commit is contained in:
parent
ed7f8d1906
commit
e58e3f3132
1 changed files with 5 additions and 1 deletions
|
@ -245,9 +245,13 @@ class Component extends Object {
|
|||
} else {
|
||||
if ($componentCn === 'SessionComponent') {
|
||||
$object->{$component} =& new $componentCn($base);
|
||||
} else {
|
||||
if (PHP5) {
|
||||
$object->{$component} = new $componentCn();
|
||||
} else {
|
||||
$object->{$component} =& new $componentCn();
|
||||
}
|
||||
}
|
||||
$object->{$component}->enabled = true;
|
||||
$this->_loaded[$component] =& $object->{$component};
|
||||
if (!empty($config)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue