From 287c26bda3f184e90c9b608466e4165a1b0942b6 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Thu, 7 Jan 2021 15:55:49 +0100 Subject: [PATCH] Replace patchwork/utf8 with symfony-polyfill-* Signed-off-by: Christoph Wurst --- 3rdparty | 2 +- lib/base.php | 3 +-- lib/private/legacy/OC_Util.php | 8 +++++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/3rdparty b/3rdparty index 875ee27505..86573beb84 160000 --- a/3rdparty +++ b/3rdparty @@ -1 +1 @@ -Subproject commit 875ee27505a280f58a893b16976fe36572fd82c4 +Subproject commit 86573beb84cf3b62b6d01ee377225df83b7d2453 diff --git a/lib/base.php b/lib/base.php index bbc777d5ea..d232ff8549 100644 --- a/lib/base.php +++ b/lib/base.php @@ -629,8 +629,7 @@ class OC { self::handleAuthHeaders(); self::registerAutoloaderCache(); - // initialize intl fallback is necessary - \Patchwork\Utf8\Bootup::initIntl(); + // initialize intl fallback if necessary OC_Util::isSetLocaleWorking(); if (!defined('PHPUNIT_RUN')) { diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php index 826d0a3112..4176dfbb22 100644 --- a/lib/private/legacy/OC_Util.php +++ b/lib/private/legacy/OC_Util.php @@ -1293,7 +1293,13 @@ class OC_Util { * @return bool */ public static function isSetLocaleWorking() { - \Patchwork\Utf8\Bootup::initLocale(); + if ('' === basename('§')) { + // Borrowed from \Patchwork\Utf8\Bootup::initLocale + setlocale(LC_ALL, 'C.UTF-8', 'C'); + setlocale(LC_CTYPE, 'en_US.UTF-8', 'fr_FR.UTF-8', 'es_ES.UTF-8', 'de_DE.UTF-8', 'ru_RU.UTF-8', 'pt_BR.UTF-8', 'it_IT.UTF-8', 'ja_JP.UTF-8', 'zh_CN.UTF-8', '0'); + } + + // Check again if ('' === basename('§')) { return false; }