From d1ed808512a8695dc10f42c96856c8ed328c39cd Mon Sep 17 00:00:00 2001 From: "John Paul E. Balandan, CPA" <51850998+paulbalandan@users.noreply.github.com> Date: Wed, 18 Aug 2021 10:33:33 +0800 Subject: [PATCH] Replace deprecated FILTER_SANITIZE_STRING --- system/Router/RouteCollection.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system/Router/RouteCollection.php b/system/Router/RouteCollection.php index b3a3f8e75f56..e975a1ac86b9 100644 --- a/system/Router/RouteCollection.php +++ b/system/Router/RouteCollection.php @@ -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; @@ -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; } @@ -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; } @@ -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...