diff options
author | Mario <mario@mariovavti.com> | 2022-10-26 21:56:32 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2022-10-26 21:56:32 +0000 |
commit | 95f6f9e10aca66c30a1ef7ac6ed24fd6e352007d (patch) | |
tree | 582116e7571ae7eaa4a51578b2f5ebeae31f75a9 /vendor/sabre/http/lib/functions.php | |
parent | ef2448e17e742e7dcef458993bce1e0a29756aa7 (diff) | |
parent | 9554f535199b5fb3a23dd40f9921a15339da3bd7 (diff) | |
download | volse-hubzilla-95f6f9e10aca66c30a1ef7ac6ed24fd6e352007d.tar.gz volse-hubzilla-95f6f9e10aca66c30a1ef7ac6ed24fd6e352007d.tar.bz2 volse-hubzilla-95f6f9e10aca66c30a1ef7ac6ed24fd6e352007d.zip |
Merge branch 'dev'
Diffstat (limited to 'vendor/sabre/http/lib/functions.php')
-rw-r--r-- | vendor/sabre/http/lib/functions.php | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/vendor/sabre/http/lib/functions.php b/vendor/sabre/http/lib/functions.php index 97673da46..d0477d943 100644 --- a/vendor/sabre/http/lib/functions.php +++ b/vendor/sabre/http/lib/functions.php @@ -349,7 +349,7 @@ function parseMimeType(string $str): array // The quality parameter, if it appears, also marks the end of // the parameter list. Anything after the q= counts as an // 'accept extension' and could introduce new semantics in - // content-negotation. + // content-negotiation. if ('q' !== $partName) { $parameters[$partName] = $part; } else { @@ -404,11 +404,9 @@ function decodePath(string $path): string function decodePathSegment(string $path): string { $path = rawurldecode($path); - $encoding = mb_detect_encoding($path, ['UTF-8', 'ISO-8859-1']); - switch ($encoding) { - case 'ISO-8859-1': - $path = utf8_encode($path); + if (!mb_check_encoding($path, 'UTF-8') && mb_check_encoding($path, 'ISO-8859-1')) { + $path = mb_convert_encoding($path, 'UTF-8', 'ISO-8859-1'); } return $path; |