mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +00:00
Adding fix for failing routes for plugins
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5475 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
504dec6d76
commit
64325bd60d
2 changed files with 9 additions and 1 deletions
|
@ -765,6 +765,14 @@ class Router extends Object {
|
||||||
} elseif (!isset($params['pass'])) {
|
} elseif (!isset($params['pass'])) {
|
||||||
$params['pass'] = '';
|
$params['pass'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($params['plugin'])) {
|
||||||
|
if(strpos($route[0], 'plugin') === false && !empty($route[2])) {
|
||||||
|
$route[2] = array_merge($route[2], array('plugin'));
|
||||||
|
$route[0] = '/:plugin' . $route[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (strpos($route[0], '*')) {
|
if (strpos($route[0], '*')) {
|
||||||
$out = str_replace('*', $params['pass'], $route[0]);
|
$out = str_replace('*', $params['pass'], $route[0]);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
||||||
*/
|
*/
|
||||||
require_once CAKE.'app_helper.php';
|
require_once CAKE.'app_helper.php';
|
||||||
uses('class_registry', 'controller'.DS.'controller', 'model'.DS.'model', 'view'.DS.'helper',
|
uses('class_registry', 'controller'.DS.'controller', 'model'.DS.'model', 'view'.DS.'helper',
|
||||||
'view'.DS.'helpers'.DS.'html', 'view'.DS.'helpers'.DS.'form');
|
'view'.DS.'helpers'.DS.'html', 'view'.DS.'helpers'.DS.'form');
|
||||||
|
|
||||||
class TheHtmlTestController extends Controller {
|
class TheHtmlTestController extends Controller {
|
||||||
|
|
Loading…
Add table
Reference in a new issue