Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a47c801

Browse files
Fix url space issue #1
1 parent d7c1963 commit a47c801

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

‎System/Router/Route.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ final class Route {
4949
*/
5050
public function __construct(String $method, String $pattern, $callback) {
5151
$this->method = $this->validateMethod(strtoupper($method));
52-
$this->pattern = $pattern;
52+
$this->pattern = cleanUrl($pattern);
5353
$this->callback = $callback;
5454
}
5555

@@ -60,7 +60,7 @@ private function validateMethod(string $method) {
6060
if (in_array(strtoupper($method), $this->list_method))
6161
return $method;
6262

63-
throw new Exception('Invalid Method Name');
63+
throw new Exception('Invalid Method Name');
6464
}
6565

6666
/**

‎System/Router/Router.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ private function getMatchRoutersByRequestMethod() {
118118
private function getMatchRoutersByPattern($pattern) {
119119
$this->matchRouter = [];
120120
foreach ($pattern as $value) {
121-
if ($this->dispatch($this->url, $value->getPattern()))
121+
if ($this->dispatch(cleanUrl($this->url), $value->getPattern()))
122122
array_push($this->matchRouter, $value);
123123
}
124124
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /