diff --git a/src/Routing/Route.php b/src/Routing/Route.php index 78c8ca9..a9a74cf 100644 --- a/src/Routing/Route.php +++ b/src/Routing/Route.php @@ -34,7 +34,7 @@ class Route implements IRoute foreach ($this->pattern as $fragment) { if (preg_match('/^{(\\w+)(\\?)?}$/', $fragment, $matches) === 1) { if (isset($parameters[$matches[1]])) { - $link[] = $parameters[$matches[1]]; + $link[] = rawurlencode($parameters[$matches[1]]); unset($parameters[$matches[1]]); } elseif (!isset($matches[2])) {//TODO: why? parameter not found but not optional $link[] = $fragment; @@ -64,7 +64,7 @@ class Route implements IRoute foreach ($path as $i => $fragment) { if (preg_match('/^{(\\w+)(?:\\?)?}$/', $this->pattern[$i], $matches) === 1) { - $parameters[$matches[1]] = $fragment; + $parameters[$matches[1]] = rawurldecode($fragment); } elseif ($fragment != $this->pattern[$i]) { return null; }