mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding fix for #2018
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4422 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
554433c7fb
commit
944e1d98bb
1 changed files with 10 additions and 2 deletions
|
@ -362,6 +362,14 @@ class Router extends Overloadable {
|
|||
$_this->{$key} = $val;
|
||||
}
|
||||
}
|
||||
|
||||
function __notEmpty($var){
|
||||
if($var === '0' || !empty($var)){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Finds URL for specified action.
|
||||
*
|
||||
|
@ -395,7 +403,6 @@ class Router extends Overloadable {
|
|||
$extension = $output = $mapped = $q = null;
|
||||
|
||||
if (is_array($url) && !empty($url)) {
|
||||
$url = array_filter($url);
|
||||
|
||||
if (isset($url['full_base']) && $url['full_base'] == true) {
|
||||
$full = true;
|
||||
|
@ -471,7 +478,8 @@ class Router extends Overloadable {
|
|||
if(!isset($url['action'])) {
|
||||
$url['action'] = null;
|
||||
}
|
||||
$urlOut = array_filter(array($url['plugin'], $url['controller'], $url['action'], join('/', array_filter($args)), $named));
|
||||
$urlOut = array_filter(array($url['plugin'], $url['controller'], $url['action'], join('/', array_filter($args, array($_this, "__notEmpty"))), $named), array($_this, "__notEmpty"));
|
||||
|
||||
if($url['plugin'] == $url['controller']) {
|
||||
array_shift($urlOut);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue