mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-10 22:32:13 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 969b64650e | |||
| c2cf2334e7 | |||
| af730e6e15 | |||
| f5a32cf520 | |||
| 1843ea0594 |
@@ -100,11 +100,6 @@ class RouterBase {
|
|||||||
// Loop through each route-request
|
// Loop through each route-request
|
||||||
$this->processRoutes($this->routes);
|
$this->processRoutes($this->routes);
|
||||||
|
|
||||||
// Make sure the urls is in the right order when comparing
|
|
||||||
usort($this->controllerUrlMap, function($a, $b) {
|
|
||||||
return strcmp($b->getUrl(), $a->getUrl());
|
|
||||||
});
|
|
||||||
|
|
||||||
$routeNotAllowed = false;
|
$routeNotAllowed = false;
|
||||||
|
|
||||||
/* @var $route RouterEntry */
|
/* @var $route RouterEntry */
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class RouterRoute extends RouterEntry {
|
|||||||
// Check if url parameter count matches
|
// Check if url parameter count matches
|
||||||
if(stripos($url, $routeMatch) === 0) {
|
if(stripos($url, $routeMatch) === 0) {
|
||||||
|
|
||||||
$matches = true;
|
$matches = (count(explode('/', rtrim($url, '/'))) == count(explode('/', rtrim($route, '/'))));
|
||||||
|
|
||||||
if($this->regexMatch) {
|
if($this->regexMatch) {
|
||||||
$parameters = $this->parseParameters($url, true, $this->regexMatch);
|
$parameters = $this->parseParameters($url, true, $this->regexMatch);
|
||||||
@@ -62,7 +62,7 @@ class RouterRoute extends RouterEntry {
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
$url = explode('/', $url);
|
$url = explode('/', $url);
|
||||||
$route = explode('/', $route);
|
$route = explode('/', rtrim($route, '/'));
|
||||||
|
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user