"Fixes #3766, RequestAction fails on plugin to app and plugin to plugin"

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6262 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-12-26 02:20:47 +00:00
parent 394ee0c8fc
commit 63bb042c9e
3 changed files with 4 additions and 5 deletions

View file

@ -501,7 +501,10 @@ class Dispatcher extends Object {
if (class_exists($ctrlClass)) {
if (low(get_parent_class($ctrlClass)) === low($name . 'AppController')) {
$params = $this->_restructureParams($params);
$count = count(explode('/', $params['url']['url']));
if ((isset($params['admin']) && $params['action'] === 'index') || (!empty($params['pass']) || $count > 2) || ($params['action'] !== 'index')) {
$params = $this->_restructureParams($params);
}
$params = $this->_restructureParams($params, true);
}
$this->params = $params;

View file

@ -90,9 +90,6 @@ class Object {
require CAKE . 'dispatcher.php';
}
$dispatcher =& new Dispatcher();
if (isset($this->plugin)) {
$extra['plugin'] = $this->plugin;
}
if (in_array('return', $extra, true)) {
$extra['return'] = 0;
$extra['bare'] = 1;

View file

@ -668,7 +668,6 @@ class DispatcherTest extends UnitTestCase {
$expected = array(0 => 5, 'param'=>'value', 'param2'=>'value2');
$this->assertEqual($controller->passedArgs, $expected);
Router::reload();
Router::connect('/admin/:controller/:action/*', array('controller' => 'pages', 'action' => 'index', 'admin' => true, 'prefix' => 'admin'));