Skip to content

Commit

Permalink
Fixed deprecated message when script is null
Browse files Browse the repository at this point in the history
(cherry picked from commit 6b984fd)
  • Loading branch information
jonasraoni committed Mar 21, 2024
1 parent 8f836a5 commit 6fc1552
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions classes/i18n/LocaleMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 6fc1552

Please sign in to comment.