1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-22 21:40:08 +00:00

Show more meaningful error message when alias is invalid

Closes #11
This commit is contained in:
Tim Düsterhus 2013-10-01 00:16:19 +02:00
parent 1060ad1512
commit 30b29ae654

View File

@ -54,14 +54,19 @@ public function __construct($text, \chat\data\room\Room $room = null) {
* @return array<string>
*/
public static function getAliasMap() {
$result = array();
foreach (explode("\n", StringUtil::unifyNewlines(StringUtil::toLowerCase(CHAT_COMMAND_ALIASES))) as $line) {
list($key, $val) = explode(':', $line, 2);
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[$key] = $val;
return $result;
}
catch (\wcf\system\exception\SystemException $e) {
throw new \wcf\system\exception\SystemException("Invalid alias specified: '".$line."'");
}
return $result;
}
/**