mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Renaming method and removing Set::filter() call.
This commit is contained in:
parent
78773020d1
commit
63cd1a3326
1 changed files with 4 additions and 9 deletions
|
@ -774,7 +774,7 @@ class Router {
|
|||
$url = $originalUrl;
|
||||
}
|
||||
if ($match === false) {
|
||||
$output = $self->_handleRouteFailure($url);
|
||||
$output = $self->_handleNoRoute($url);
|
||||
}
|
||||
$output = str_replace('//', '/', $base . '/' . $output);
|
||||
} else {
|
||||
|
@ -809,7 +809,6 @@ class Router {
|
|||
if (!empty($extension) && substr($output, -1) === '/') {
|
||||
$output = substr($output, 0, -1);
|
||||
}
|
||||
|
||||
return $output . $extension . $self->queryString($q, array(), $escape) . $frag;
|
||||
}
|
||||
|
||||
|
@ -821,7 +820,7 @@ class Router {
|
|||
* @return string A generated url for the array
|
||||
* @see Router::url()
|
||||
*/
|
||||
function _handleRouteFailure($url) {
|
||||
function _handleNoRoute($url) {
|
||||
$named = $args = array();
|
||||
$skip = array_merge(
|
||||
array('bare', 'action', 'controller', 'plugin', 'prefix'),
|
||||
|
@ -852,7 +851,7 @@ class Router {
|
|||
$url['action'] = null;
|
||||
}
|
||||
|
||||
$urlOut = Set::filter(array($url['controller'], $url['action']));
|
||||
$urlOut = array_filter(array($url['controller'], $url['action']));
|
||||
|
||||
if (isset($url['plugin']) && $url['plugin'] != $url['controller']) {
|
||||
array_unshift($urlOut, $url['plugin']);
|
||||
|
@ -867,11 +866,7 @@ class Router {
|
|||
$output = implode('/', $urlOut);
|
||||
|
||||
if (!empty($args)) {
|
||||
$args = implode('/', $args);
|
||||
if ($output{strlen($output) - 1} != '/') {
|
||||
$args = '/' . $args;
|
||||
}
|
||||
$output .= $args;
|
||||
$output .= '/' . implode('/', $args);
|
||||
}
|
||||
|
||||
if (!empty($named)) {
|
||||
|
|
Loading…
Reference in a new issue