mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 23:22:11 +00:00
[BUGFIX] Fixed router for controller and ressources not matching /something?
This commit is contained in:
@@ -16,9 +16,8 @@ class RouterController extends RouterEntry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function matchRoute($requestMethod, $url) {
|
public function matchRoute($requestMethod, $url) {
|
||||||
|
|
||||||
$url = parse_url($url);
|
$url = parse_url($url);
|
||||||
$url = $url['path'];
|
$url = rtrim($url['path'], '/') . '/';
|
||||||
|
|
||||||
if(strtolower($url) == strtolower($this->url) || stripos($url, $this->url) === 0) {
|
if(strtolower($url) == strtolower($this->url) || stripos($url, $this->url) === 0) {
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class RouterRessource extends RouterEntry {
|
|||||||
|
|
||||||
public function matchRoute($requestMethod, $url) {
|
public function matchRoute($requestMethod, $url) {
|
||||||
$url = parse_url($url);
|
$url = parse_url($url);
|
||||||
$url = $url['path'];
|
$url = rtrim($url['path'], '/') . '/';
|
||||||
|
|
||||||
if(strtolower($url) == strtolower($this->url) || stripos($url, $this->url) === 0) {
|
if(strtolower($url) == strtolower($this->url) || stripos($url, $this->url) === 0) {
|
||||||
$url = rtrim($url, '/');
|
$url = rtrim($url, '/');
|
||||||
|
|||||||
Reference in New Issue
Block a user