Skip to content

Commit

Permalink
Check whether setlocale works only after setlocale
Browse files Browse the repository at this point in the history
Signed-off-by: Naoto Kobayashi <naoto.kobayashi4c@gmail.com>
  • Loading branch information
YoitoFes committed Nov 14, 2021
1 parent 455bff5 commit d2eb5aa
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/private/legacy/OC_Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -1249,12 +1249,13 @@ public static function isSetLocaleWorking() {
// 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 ('' === escapeshellcmd('§')) {
return false;
// Check again
if ('' === escapeshellcmd('§')) {
return false;
}
}

return true;
}

Expand Down

0 comments on commit d2eb5aa

Please sign in to comment.