| Total Complexity | 3 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Coverage | 50% |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | class Sanitize |
||
| 6 | { |
||
| 7 | |||
| 8 | /** |
||
| 9 | * The NUL character is a demon, because it can be used to bypass other tests |
||
| 10 | * See https://st-g.de/2011/04/doing-filename-checks-securely-in-PHP. |
||
| 11 | * |
||
| 12 | * @param string $string string remove NUL characters in |
||
| 13 | */ |
||
| 14 | 1 | public static function removeNUL($string) |
|
| 15 | { |
||
| 16 | 1 | return str_replace(chr(0), '', $string); |
|
| 17 | } |
||
| 18 | |||
| 19 | 1 | public static function removeStreamWrappers($string) |
|
| 20 | { |
||
| 21 | 1 | return preg_replace('#^\\w+://#', '', $string); |
|
| 22 | } |
||
| 23 | |||
| 24 | public static function path($string) |
||
| 29 | } |
||
| 30 | } |
||
| 31 |