|
19 | 19 | use InvalidArgumentException; |
20 | 20 |
|
21 | 21 | /** |
22 | | - * Class RouteCollection |
23 | | - * |
24 | 22 | * @todo Implement nested resource routing (See CakePHP) |
25 | 23 | */ |
26 | 24 | class RouteCollection implements RouteCollectionInterface |
@@ -663,10 +661,11 @@ public function resource(string $name, ?array $options = null): RouteCollectionI |
663 | 661 | // resources are sent to, we need to have a new name |
664 | 662 | // to store the values in. |
665 | 663 | $newName = implode('\\', array_map('ucfirst', explode('/', $name))); |
| 664 | + |
666 | 665 | // If a new controller is specified, then we replace the |
667 | 666 | // $name value with the name of the new controller. |
668 | 667 | if (isset($options['controller'])) { |
669 | | - $newName = ucfirst(filter_var($options['controller'], FILTER_SANITIZE_STRING)); |
| 668 | + $newName = ucfirst(esc(strip_tags($options['controller']))); |
670 | 669 | } |
671 | 670 |
|
672 | 671 | // In order to allow customization of allowed id values |
@@ -756,10 +755,11 @@ public function presenter(string $name, ?array $options = null): RouteCollection |
756 | 755 | // resources are sent to, we need to have a new name |
757 | 756 | // to store the values in. |
758 | 757 | $newName = implode('\\', array_map('ucfirst', explode('/', $name))); |
| 758 | + |
759 | 759 | // If a new controller is specified, then we replace the |
760 | 760 | // $name value with the name of the new controller. |
761 | 761 | if (isset($options['controller'])) { |
762 | | - $newName = ucfirst(filter_var($options['controller'], FILTER_SANITIZE_STRING)); |
| 762 | + $newName = ucfirst(esc(strip_tags($options['controller']))); |
763 | 763 | } |
764 | 764 |
|
765 | 765 | // In order to allow customization of allowed id values |
|
0 commit comments