Skip to content

Commit

Permalink
Ensuring that classes returned by ClassRegistry::init() are model ins…
Browse files Browse the repository at this point in the history
…tances
  • Loading branch information
lorenzo committed Jul 14, 2011
1 parent 60b44e0 commit e8efc67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Cake/Utility/ClassRegistry.php
Expand Up @@ -135,7 +135,7 @@ public static function init($class, $strict = false) {
App::uses($plugin . 'AppModel', $pluginPath . 'Model');
App::uses($class, $pluginPath . 'Model');

if (class_exists($class)) {
if (class_exists($class) && $class instanceof Model) {
${$class} = new $class($settings);
} else {
if ($strict) {
Expand Down

0 comments on commit e8efc67

Please sign in to comment.