Skip to content

Commit

Permalink
Adding a backwards compatible check to ClassRegistry::init() so it is…
Browse files Browse the repository at this point in the history
… still able to return classes that are not instance of Model
  • Loading branch information
lorenzo committed Jul 24, 2011
1 parent d63dde0 commit 31efa02
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Cake/Utility/ClassRegistry.php
Expand Up @@ -137,7 +137,9 @@ public static function init($class, $strict = false) {

if (class_exists($class)) {
${$class} = new $class($settings);
${$class} = (${$class} instanceof Model) ? ${$class} : null;
if ($strict) {
${$class} = (${$class} instanceof Model) ? ${$class} : null;
}
}
if (!isset(${$class})) {
if ($strict) {
Expand Down

0 comments on commit 31efa02

Please sign in to comment.