Conditions | 1 |
Paths | 1 |
Total Lines | 10 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
33 | public static function sanitizeUrl(string $url): string |
||
34 | { |
||
35 | // HTML decode the entities, then strip out any tags |
||
36 | $url = html_entity_decode($url, ENT_NOQUOTES, 'UTF-8'); |
||
37 | $url = strip_tags($url); |
||
38 | // Remove any Twig tags that somehow are present in the incoming URL |
||
39 | /** @noinspection CallableParameterUseCaseInTypeContextInspection */ |
||
40 | $url = preg_replace('/{.*}/', '', $url); |
||
41 | |||
42 | return $url; |
||
43 | } |
||
45 |