1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-22 21:40:08 +00:00
Tim Düsterhus 2014-03-10 18:32:56 +01:00
parent 9d8359a52c
commit 3997f674a4

View File

@ -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;