setlocale could be called with no second param if the language given to
the modified function was empty.
* Set the system date locale for localized date formatting.
* Will try both the standard locale name and the UTF8 variant.
*/
* Set the system date locale for localized date formatting.
* Will try both the standard locale name and the UTF8 variant.
*/
- public function setPhpDateTimeLocale(string $language)
+ public function setPhpDateTimeLocale(string $language): void
{
$isoLang = $this->localeMap[$language]['iso'] ?? false;
{
$isoLang = $this->localeMap[$language]['iso'] ?? false;
- setlocale(LC_TIME, ...$locales);
+ if (!empty($locales)) {
+ setlocale(LC_TIME, ...$locales);
+ }