Skip to content

Commit

Permalink
Merge pull request #95 from AIPTU/patch-1
Browse files Browse the repository at this point in the history
Fix TypeError: str_replace() PHP8
  • Loading branch information
Shock95 authored Oct 27, 2021
2 parents 5ca406b + 1ff65e0 commit 6b06f6b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/shock95x/auctionhouse/utils/Locale.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static function loadLanguages(String $dataFolder): void {
self::$translation[strtolower($localeCode)] = $config->getAll();
array_walk_recursive(self::$translation[strtolower($localeCode)], function (&$element) {
$element ??= "";
$element = str_replace("&", "\xc2\xa7", $element);
$element = str_replace("&", "\xc2\xa7", (string) $element);
});
unset(self::$translation[strtolower($localeCode)]["lang-version"]);
}
Expand Down Expand Up @@ -70,4 +70,4 @@ public static function getMessage(Player $player, string $key, bool $prefix = fa
}
return $prefix ? Utils::prefixMessage(self::$translation[strtolower($locale)][$key]) : self::$translation[strtolower($locale)][$key];
}
}
}

0 comments on commit 6b06f6b

Please sign in to comment.