Skip to content

Commit

Permalink
Adding php5 check to avoid errors when using __get() or __isset() met…
Browse files Browse the repository at this point in the history
…hods in models
  • Loading branch information
lorenzo committed Jan 13, 2010
1 parent d825751 commit 8496055
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cake/libs/model/behaviors/acl.php
Expand Up @@ -53,7 +53,11 @@ function setup(&$model, $config = array()) {
if (!class_exists('AclNode')) {
require LIBS . 'model' . DS . 'db_acl.php';
}
$model->{$type} =& ClassRegistry::init($type);
if (PHP5) {
$model->{$type} = ClassRegistry::init($type);
} else {
$model->{$type} =& ClassRegistry::init($type);
}
if (!method_exists($model, 'parentNode')) {
trigger_error("Callback parentNode() not defined in {$model->alias}", E_USER_WARNING);
}
Expand Down

0 comments on commit 8496055

Please sign in to comment.