diff options
author | Naoto Kobayashi <naoto.kobayashi4c@gmail.com> | 2021-11-13 18:58:36 +0300 |
---|---|---|
committer | Naoto Kobayashi <naoto.kobayashi4c@gmail.com> | 2021-11-14 03:18:59 +0300 |
commit | 455bff5c1703a71dfe25c2d066c06e88eb4280a8 (patch) | |
tree | 53101f4d9d694042daf483b869565bc14c966d62 /lib/private/legacy/OC_Util.php | |
parent | 7071d056a20d627b0be58ec66fb3e5347fd90c8d (diff) |
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/OC_Util.php')
-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 35c81dd34e6..94fcb900898 100644 --- a/lib/private/legacy/OC_Util.php +++ b/lib/private/legacy/OC_Util.php @@ -1245,14 +1245,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; |