mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-10-31 14:10:08 +00:00
Fix empty command alias list
See https://tims.bastelstu.be/forum/index.php/Thread/133-Fehlermeldung-wenn-keine-Befehls-Aliase-definiert-wurden/
This commit is contained in:
parent
9d8359a52c
commit
3997f674a4
@ -54,12 +54,14 @@ public function __construct($text, \chat\data\room\Room $room = null) {
|
||||
* @return array<string>
|
||||
*/
|
||||
public static function getAliasMap() {
|
||||
if (StringUtil::trim(CHAT_COMMAND_ALIASES) === '') return array();
|
||||
|
||||
try {
|
||||
$result = array();
|
||||
foreach (explode("\n", StringUtil::unifyNewlines(StringUtil::toLowerCase(CHAT_COMMAND_ALIASES))) as $line) {
|
||||
list($key, $val) = explode(':', $line, 2);
|
||||
|
||||
$result[$key] = $val;
|
||||
$result[StringUtil::trim($key)] = StringUtil::trim($val);
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
Loading…
Reference in New Issue
Block a user