Fixing undefined index notice with admin routes

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4081 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2006-12-07 22:41:20 +00:00
parent 7fd83394ca
commit a7d07aea20

View file

@ -396,7 +396,7 @@ class Router extends Overloadable {
}
if (defined('CAKE_ADMIN') && !isset($url[CAKE_ADMIN]) && isset($params[CAKE_ADMIN])) {
$url[CAKE_ADMIN] = $params[CAKE_ADMIN];
} elseif (defined('CAKE_ADMIN') && $url[CAKE_ADMIN] == false) {
} elseif (defined('CAKE_ADMIN') && isset($url[CAKE_ADMIN]) && $url[CAKE_ADMIN] == false) {
unset($url[CAKE_ADMIN]);
}
@ -473,7 +473,7 @@ class Router extends Overloadable {
$output = $base . $url;
} else {
$output = $base . '/';
if (defined('CAKE_ADMIN')) {
if (defined('CAKE_ADMIN') && isset($params[CAKE_ADMIN])) {
$output .= CAKE_ADMIN . '/';
}
$output .= strtolower($params['controller']) . '/' . $url;