From 6fc15525d782b6bee55167c6c6f574b55dad1af1 Mon Sep 17 00:00:00 2001 From: Jonas Raoni Soares da Silva Date: Thu, 21 Mar 2024 13:47:17 +0300 Subject: [PATCH] Fixed deprecated message when script is null (cherry picked from commit 6b984fdbe8cd9ea8e0420f02e66ef4f8d6cf94ec) --- classes/i18n/LocaleMetadata.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/i18n/LocaleMetadata.php b/classes/i18n/LocaleMetadata.php index f0b30b2e911..26605acc504 100644 --- a/classes/i18n/LocaleMetadata.php +++ b/classes/i18n/LocaleMetadata.php @@ -180,8 +180,8 @@ public function getCountry(?string $locale = null): ?string */ public function getScript(?string $locale = null): ?string { - $script = ucfirst($this->_parse()->script); - return $this->_parse()->script ? Locale::getScripts($locale)->getByAlpha4($script)->getLocalName() : null; + $script = ucfirst($this->_parse()->script ?? ''); + return $script ? Locale::getScripts($locale)->getByAlpha4($script)->getLocalName() : null; } /**