mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Doing some code cleanup and moving conditionals around.
This commit is contained in:
parent
dbce29a058
commit
3a95a546e8
1 changed files with 10 additions and 5 deletions
|
@ -756,6 +756,10 @@ class Router {
|
|||
$frag = '#' . urlencode($url['#']);
|
||||
unset($url['#']);
|
||||
}
|
||||
if (isset($url['ext'])) {
|
||||
$extension = '.' . $url['ext'];
|
||||
unset($url['ext']);
|
||||
}
|
||||
if (empty($url['action'])) {
|
||||
if (empty($url['controller']) || $params['controller'] === $url['controller']) {
|
||||
$url['action'] = $params['action'];
|
||||
|
@ -778,10 +782,6 @@ class Router {
|
|||
|
||||
$url += array('controller' => $params['controller'], 'plugin' => $params['plugin']);
|
||||
|
||||
if (isset($url['ext'])) {
|
||||
$extension = '.' . $url['ext'];
|
||||
unset($url['ext']);
|
||||
}
|
||||
$match = false;
|
||||
|
||||
for ($i = 0, $len = count(self::$routes); $i < $len; $i++) {
|
||||
|
@ -801,7 +801,12 @@ class Router {
|
|||
$output = self::_handleNoRoute($url);
|
||||
}
|
||||
} else {
|
||||
if (((strpos($url, '://')) || (strpos($url, 'javascript:') === 0) || (strpos($url, 'mailto:') === 0)) || (!strncmp($url, '#', 1))) {
|
||||
if (
|
||||
(strpos($url, '://') ||
|
||||
(strpos($url, 'javascript:') === 0) ||
|
||||
(strpos($url, 'mailto:') === 0)) ||
|
||||
(!strncmp($url, '#', 1))
|
||||
) {
|
||||
return $url;
|
||||
}
|
||||
if (substr($url, 0, 1) === '/') {
|
||||
|
|
Loading…
Reference in a new issue