From e58e3f3132da50dcad4026bcf1822e27702e3c4b Mon Sep 17 00:00:00 2001 From: Joe Beeson Date: Fri, 21 Jan 2011 13:23:29 -0700 Subject: [PATCH] Fix to resolve 'assign by reference' errors when using a '__get' magic method. Fixes #1476 Signed-off-by: mark_story --- cake/libs/controller/component.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cake/libs/controller/component.php b/cake/libs/controller/component.php index d2d708cc3..b1cb50c0d 100644 --- a/cake/libs/controller/component.php +++ b/cake/libs/controller/component.php @@ -246,7 +246,11 @@ class Component extends Object { if ($componentCn === 'SessionComponent') { $object->{$component} =& new $componentCn($base); } else { - $object->{$component} =& new $componentCn(); + if (PHP5) { + $object->{$component} = new $componentCn(); + } else { + $object->{$component} =& new $componentCn(); + } } $object->{$component}->enabled = true; $this->_loaded[$component] =& $object->{$component};