Browse files

Ensuring that classes returned by ClassRegistry::init() are model ins…

…tances
  • Loading branch information...
1 parent 60b44e0 commit e8efc67d3d126795bfd81e2c53d3604ed37d43ce @lorenzo lorenzo committed Jul 14, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Cake/Utility/ClassRegistry.php
View
2 lib/Cake/Utility/ClassRegistry.php
@@ -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) {

0 comments on commit e8efc67

Please sign in to comment.