Skip to content

Commit 93d8c26

Browse files
committed
[BUGFIX] Fixed router for controller and ressources not matching /something?
1 parent aec1f5f commit 93d8c26

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/Pecee/SimpleRouter/RouterController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ public function __construct($url, $controller) {
1616
}
1717

1818
public function matchRoute($requestMethod, $url) {
19-
2019
$url = parse_url($url);
21-
$url = $url['path'];
20+
$url = rtrim($url['path'], '/') . '/';
2221

2322
if(strtolower($url) == strtolower($this->url) || stripos($url, $this->url) === 0) {
2423

src/Pecee/SimpleRouter/RouterRessource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ protected function call($method, $parameters) {
5353

5454
public function matchRoute($requestMethod, $url) {
5555
$url = parse_url($url);
56-
$url = $url['path'];
56+
$url = rtrim($url['path'], '/') . '/';
5757

5858
if(strtolower($url) == strtolower($this->url) || stripos($url, $this->url) === 0) {
5959
$url = rtrim($url, '/');

0 commit comments

Comments
 (0)