mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40: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>
|
* @return array<string>
|
||||||
*/
|
*/
|
||||||
public static function getAliasMap() {
|
public static function getAliasMap() {
|
||||||
|
if (StringUtil::trim(CHAT_COMMAND_ALIASES) === '') return array();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$result = array();
|
$result = array();
|
||||||
foreach (explode("\n", StringUtil::unifyNewlines(StringUtil::toLowerCase(CHAT_COMMAND_ALIASES))) as $line) {
|
foreach (explode("\n", StringUtil::unifyNewlines(StringUtil::toLowerCase(CHAT_COMMAND_ALIASES))) as $line) {
|
||||||
list($key, $val) = explode(':', $line, 2);
|
list($key, $val) = explode(':', $line, 2);
|
||||||
|
|
||||||
$result[$key] = $val;
|
$result[StringUtil::trim($key)] = StringUtil::trim($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
|
Loading…
Reference in New Issue
Block a user