Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Renaming method and removing Set::filter() call.

  • Loading branch information...
commit 63cd1a332652a57e7aec6bddfcb9ec95cd86f10c 1 parent 7877302
@markstory markstory authored
Showing with 4 additions and 9 deletions.
  1. +4 −9 cake/libs/router.php
View
13 cake/libs/router.php
@@ -774,7 +774,7 @@ function url($url = null, $full = false) {
$url = $originalUrl;
}
if ($match === false) {
- $output = $self->_handleRouteFailure($url);
+ $output = $self->_handleNoRoute($url);
}
$output = str_replace('//', '/', $base . '/' . $output);
} else {
@@ -809,7 +809,6 @@ function url($url = null, $full = false) {
if (!empty($extension) && substr($output, -1) === '/') {
$output = substr($output, 0, -1);
}
-
return $output . $extension . $self->queryString($q, array(), $escape) . $frag;
}
@@ -821,7 +820,7 @@ function url($url = null, $full = false) {
* @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 @@ function _handleRouteFailure($url) {
$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 @@ function _handleRouteFailure($url) {
$output = implode('/', $urlOut);
if (!empty($args)) {
- $args = implode('/', $args);
- if ($output{strlen($output) - 1} != '/') {
- $args = '/' . $args;
- }
- $output .= $args;
+ $output .= '/' . implode('/', $args);
}
if (!empty($named)) {
Please sign in to comment.
Something went wrong with that request. Please try again.