diff options
author | Naoto Kobayashi <naoto.kobayashi4c@gmail.com> | 2021-11-14 00:58:36 +0900 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2021-11-17 09:01:40 +0000 |
commit | e9c6de5c79c486ff1af3c1ed853dd1302a758270 (patch) | |
tree | a48c1749bd3341829c73381b35b789bf629ceb91 /lib/private/legacy | |
parent | f5b155266d203aa47c1c9a27a7ae2d6d3ca9ddbc (diff) | |
download | nextcloud-server-e9c6de5c79c486ff1af3c1ed853dd1302a758270.tar.gz nextcloud-server-e9c6de5c79c486ff1af3c1ed853dd1302a758270.zip |
Fix missing setlocale with php 8
When php version = 8, basename('§') does not bug even if LC_ALL is non-UTF-8 locale.
This cause OC_Util::isSetLocaleWorking() to skip setlocale("C.UTF-8").
Fix it by using escapeshellcmd instead of basename.
Signed-off-by: Naoto Kobayashi <naoto.kobayashi4c@gmail.com>
Diffstat (limited to 'lib/private/legacy')
-rw-r--r-- | lib/private/legacy/OC_Util.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php index f1e88166e97..1a029e9006f 100644 --- a/lib/private/legacy/OC_Util.php +++ b/lib/private/legacy/OC_Util.php @@ -1298,14 +1298,14 @@ class OC_Util { * @return bool */ public static function isSetLocaleWorking() { - if ('' === basename('§')) { + if ('' === escapeshellcmd('§')) { // 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('§')) { + if ('' === escapeshellcmd('§')) { return false; } return true; |