From 3997f674a4d02092e43c0dc43f84277367b038f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 10 Mar 2014 18:32:56 +0100 Subject: [PATCH] Fix empty command alias list See https://tims.bastelstu.be/forum/index.php/Thread/133-Fehlermeldung-wenn-keine-Befehls-Aliase-definiert-wurden/ --- file/lib/system/command/CommandHandler.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/file/lib/system/command/CommandHandler.class.php b/file/lib/system/command/CommandHandler.class.php index 6961ff5..4a3cd8a 100644 --- a/file/lib/system/command/CommandHandler.class.php +++ b/file/lib/system/command/CommandHandler.class.php @@ -54,12 +54,14 @@ public function __construct($text, \chat\data\room\Room $room = null) { * @return array */ 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;