diff --git a/file/lib/system/command/CommandHandler.class.php b/file/lib/system/command/CommandHandler.class.php index bf3607c..a01e3c4 100644 --- a/file/lib/system/command/CommandHandler.class.php +++ b/file/lib/system/command/CommandHandler.class.php @@ -39,6 +39,11 @@ final class CommandHandler { public function __construct($text, \chat\data\room\Room $room = null) { $this->text = $text; $this->room = $room; + + $aliases = self::getAliasMap(); + foreach ($aliases as $search => $replace) { + $this->text = \wcf\system\Regex::compile('^'.preg_quote($search))->replace($this->text, $replace); + } } /** @@ -106,9 +111,6 @@ public function loadCommand() { return new commands\PlainCommand($this); } - $aliases = self::getAliasMap(); - if (isset($aliases[$parts[0]])) $parts[0] = $aliases[$parts[0]]; - $class = '\chat\system\command\commands\\'.ucfirst(strtolower($parts[0])).'Command'; if (!class_exists($class)) { throw new NotFoundException();