Skip to content

Commit

Permalink
webui: adapt to php 8.0 changes in array_key_exists()
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorz committed Nov 5, 2021
1 parent c260806 commit 67646bb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function load($locale, $filename)
}

// Read header entries
if (array_key_exists('', $textDomain)) {
if ($textDomain->offsetExists('')) {
$rawHeaders = explode("\n", trim($textDomain['']));

foreach ($rawHeaders as $rawHeader) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function load($locale, $filename)

$textDomain = new TextDomain($messages);

if (array_key_exists('', $textDomain)) {
if ($textDomain->offsetExists('')) {
if (isset($textDomain['']['plural_forms'])) {
$textDomain->setPluralRule(
PluralRule::fromString($textDomain['']['plural_forms'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function load($locale, $textDomain)

$textDomain = new TextDomain($this->messages[$textDomain][$locale]);

if (array_key_exists('', $textDomain)) {
if ($textDomain->offsetExists('')) {
if (isset($textDomain['']['plural_forms'])) {
$textDomain->setPluralRule(
PluralRule::fromString($textDomain['']['plural_forms'])
Expand Down

0 comments on commit 67646bb

Please sign in to comment.