Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions system/Router/RouteCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public function addPlaceholder($placeholder, ?string $pattern = null): RouteColl
*/
public function setDefaultNamespace(string $value): RouteCollectionInterface
{
$this->defaultNamespace = filter_var($value, FILTER_SANITIZE_STRING);
$this->defaultNamespace = esc(strip_tags($value));
$this->defaultNamespace = rtrim($this->defaultNamespace, '\\') . '\\';

return $this;
Expand All @@ -258,7 +258,7 @@ public function setDefaultNamespace(string $value): RouteCollectionInterface
*/
public function setDefaultController(string $value): RouteCollectionInterface
{
$this->defaultController = filter_var($value, FILTER_SANITIZE_STRING);
$this->defaultController = esc(strip_tags($value));

return $this;
}
Expand All @@ -269,7 +269,7 @@ public function setDefaultController(string $value): RouteCollectionInterface
*/
public function setDefaultMethod(string $value): RouteCollectionInterface
{
$this->defaultMethod = filter_var($value, FILTER_SANITIZE_STRING);
$this->defaultMethod = esc(strip_tags($value));

return $this;
}
Expand Down Expand Up @@ -1090,7 +1090,7 @@ protected function create(string $verb, string $from, $to, ?array $options = nul
$overwrite = false;
$prefix = $this->group === null ? '' : $this->group . '/';

$from = filter_var($prefix . $from, FILTER_SANITIZE_STRING);
$from = esc(strip_tags($prefix . $from));

// While we want to add a route within a group of '/',
// it doesn't work with matching, so remove them...
Expand Down