Skip to content

Commit

Permalink
Replace deprecated FILTER_SANITIZE_STRING
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbalandan authored Aug 18, 2021
1 parent 5c8d1ae commit d1ed808
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit d1ed808

Please sign in to comment.