diff --git a/src/serverlib/3rdparty/SabreDAV/vendor/sabre/dav/lib/DAV/StringUtil.php b/src/serverlib/3rdparty/SabreDAV/vendor/sabre/dav/lib/DAV/StringUtil.php index 10eeceb..e6699b7 100644 --- a/src/serverlib/3rdparty/SabreDAV/vendor/sabre/dav/lib/DAV/StringUtil.php +++ b/src/serverlib/3rdparty/SabreDAV/vendor/sabre/dav/lib/DAV/StringUtil.php @@ -81,7 +81,7 @@ class StringUtil { $encoding = mb_detect_encoding($input, ['UTF-8', 'ISO-8859-1'], true); if ($encoding === 'ISO-8859-1') { - return utf8_encode($input); + return mb_convert_encoding($input, 'UTF-8', 'ISO-8859-1'); } else { return $input; } diff --git a/src/serverlib/3rdparty/SabreDAV/vendor/sabre/http/lib/functions.php b/src/serverlib/3rdparty/SabreDAV/vendor/sabre/http/lib/functions.php index 1ec123f..520d7ee 100644 --- a/src/serverlib/3rdparty/SabreDAV/vendor/sabre/http/lib/functions.php +++ b/src/serverlib/3rdparty/SabreDAV/vendor/sabre/http/lib/functions.php @@ -431,13 +431,8 @@ function decodePath($path) { function decodePathSegment($path) { $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; diff --git a/src/serverlib/3rdparty/SabreDAV/vendor/sabre/vobject/lib/StringUtil.php b/src/serverlib/3rdparty/SabreDAV/vendor/sabre/vobject/lib/StringUtil.php index 1ecb6d1..5d52cd9 100644 --- a/src/serverlib/3rdparty/SabreDAV/vendor/sabre/vobject/lib/StringUtil.php +++ b/src/serverlib/3rdparty/SabreDAV/vendor/sabre/vobject/lib/StringUtil.php @@ -43,14 +43,12 @@ class StringUtil { switch($encoding) { case 'ISO-8859-1' : - $newStr = utf8_encode($str); + //$newStr = utf8_encode($str); + $newStr = mb_convert_encoding($str, 'UTF-8', 'ISO-8859-1'); break; - /* Unreachable code. Not sure yet how we can improve this - * situation. case 'WINDOWS-1252' : - $newStr = iconv('cp1252', 'UTF-8', $str); + $newStr = mb_convert_encoding($str, 'UTF-8', 'WINDOWS-1252'); break; - */ default : $newStr = $str;