Fixing wrong class_exists check. Fixes #5474.

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7653 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
renan.saddam 2008-09-24 02:12:35 +00:00
parent 5245b3fa7c
commit 3459fef98f

View file

@ -133,8 +133,9 @@ class ClassRegistry {
if (class_exists($class) || App::import($type, $plugin . $class)) {
${$class} =& new $class($settings);
} elseif ($type === 'Model') {
if ($plugin && class_exists($plugin .'AppModel')) {
$appModel = $plugin .'AppModel';
$plugin = substr($plugin, 0, -1);
if ($plugin && class_exists($plugin . 'AppModel')) {
$appModel = $plugin . 'AppModel';
} else {
$appModel = 'AppModel';
}