@@ -246,7 +246,7 @@ public function addPlaceholder($placeholder, ?string $pattern = null): RouteColl
246246 */
247247 public function setDefaultNamespace (string $ value ): RouteCollectionInterface
248248 {
249- $ this ->defaultNamespace = filter_var ( $ value, FILTER_SANITIZE_STRING );
249+ $ this ->defaultNamespace = esc ( strip_tags ( $ value) );
250250 $ this ->defaultNamespace = rtrim ($ this ->defaultNamespace , '\\' ) . '\\' ;
251251
252252 return $ this ;
@@ -258,7 +258,7 @@ public function setDefaultNamespace(string $value): RouteCollectionInterface
258258 */
259259 public function setDefaultController (string $ value ): RouteCollectionInterface
260260 {
261- $ this ->defaultController = filter_var ( $ value, FILTER_SANITIZE_STRING );
261+ $ this ->defaultController = esc ( strip_tags ( $ value) );
262262
263263 return $ this ;
264264 }
@@ -269,7 +269,7 @@ public function setDefaultController(string $value): RouteCollectionInterface
269269 */
270270 public function setDefaultMethod (string $ value ): RouteCollectionInterface
271271 {
272- $ this ->defaultMethod = filter_var ( $ value, FILTER_SANITIZE_STRING );
272+ $ this ->defaultMethod = esc ( strip_tags ( $ value) );
273273
274274 return $ this ;
275275 }
@@ -1090,7 +1090,7 @@ protected function create(string $verb, string $from, $to, ?array $options = nul
10901090 $ overwrite = false ;
10911091 $ prefix = $ this ->group === null ? '' : $ this ->group . '/ ' ;
10921092
1093- $ from = filter_var ( $ prefix . $ from, FILTER_SANITIZE_STRING );
1093+ $ from = esc ( strip_tags ( $ prefix . $ from) );
10941094
10951095 // While we want to add a route within a group of '/',
10961096 // it doesn't work with matching, so remove them...
0 commit comments