Conditions | 4 |
Paths | 3 |
Total Lines | 35 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 16 |
CRAP Score | 4 |
Changes | 4 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
4993 | 6 | public static function rawurldecode(string $str, bool $multi_decode = true): string |
|
4994 | { |
||
4995 | 6 | if ($str === '') { |
|
4996 | 4 | return ''; |
|
4997 | } |
||
4998 | |||
4999 | 6 | $str = self::urldecode_unicode_helper($str); |
|
5000 | |||
5001 | 6 | if ($multi_decode) { |
|
5002 | do { |
||
5003 | 5 | $str_compare = $str; |
|
5004 | |||
5005 | /** |
||
5006 | * @psalm-suppress PossiblyInvalidArgument |
||
5007 | */ |
||
5008 | 5 | $str = \rawurldecode( |
|
5009 | 5 | self::html_entity_decode( |
|
5010 | 5 | self::to_utf8($str), |
|
5011 | 5 | \ENT_QUOTES | \ENT_HTML5 |
|
5012 | ) |
||
5013 | ); |
||
5014 | 5 | } while ($str_compare !== $str); |
|
5015 | } else { |
||
5016 | /** |
||
5017 | * @psalm-suppress PossiblyInvalidArgument |
||
5018 | */ |
||
5019 | 1 | $str = \rawurldecode( |
|
5020 | 1 | self::html_entity_decode( |
|
5021 | 1 | self::to_utf8($str), |
|
5022 | 1 | \ENT_QUOTES | \ENT_HTML5 |
|
5023 | ) |
||
5024 | ); |
||
5025 | } |
||
5026 | |||
5027 | 6 | return self::fix_simple_utf8($str); |
|
5028 | } |
||
13722 |