mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Adding fix for Router::url() when static call is made outside of an object instance
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5329 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
4b2e8dffe3
commit
03ea2b8287
1 changed files with 8 additions and 4 deletions
|
@ -458,18 +458,22 @@ class Router extends Object {
|
|||
$defaults = $params = array('plugin' => null, 'controller' => null, 'action' => 'index');
|
||||
|
||||
if (!empty($_this->__params)) {
|
||||
if (!isset($this->params['requested'])) {
|
||||
if (isset($this) && !isset($this->params['requested'])) {
|
||||
$params = $_this->__params[0];
|
||||
} elseif (isset($this->params['requested'])) {
|
||||
} elseif (isset($this) && isset($this->params['requested'])) {
|
||||
$params = end($_this->__params);
|
||||
} else {
|
||||
$params = end($_this->__params);
|
||||
}
|
||||
}
|
||||
$path = array('base' => null);
|
||||
|
||||
if (!empty($_this->__paths)) {
|
||||
if (!isset($this->params['requested'])) {
|
||||
if (isset($this) && !isset($this->params['requested'])) {
|
||||
$path = $_this->__paths[0];
|
||||
} elseif (isset($this->params['requested'])) {
|
||||
} elseif (isset($this) && isset($this->params['requested'])) {
|
||||
$path = end($_this->__paths);
|
||||
} else {
|
||||
$path = end($_this->__paths);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue