diff --git a/file/lib/data/message/MessageAction.class.php b/file/lib/data/message/MessageAction.class.php index 7d8caf4..bc7d434 100644 --- a/file/lib/data/message/MessageAction.class.php +++ b/file/lib/data/message/MessageAction.class.php @@ -66,7 +66,7 @@ public function validateSend() { $this->parameters['enableHTML'] = false; // validate text - if (\wcf\util\StringUtil::length($this->parameters['text']) > CHAT_MAX_LENGTH) throw new UserInputException('text', 'tooLong'); + if (mb_strlen($this->parameters['text']) > CHAT_MAX_LENGTH) throw new UserInputException('text', 'tooLong'); // search for disallowed bbcodes $disallowedBBCodes = \wcf\system\bbcode\BBCodeParser::getInstance()->validateBBCodes($this->parameters['text'], explode(',', WCF::getSession()->getPermission('user.chat.allowedBBCodes'))); diff --git a/file/lib/page/ChatPage.class.php b/file/lib/page/ChatPage.class.php index 76b339c..bbff697 100644 --- a/file/lib/page/ChatPage.class.php +++ b/file/lib/page/ChatPage.class.php @@ -147,7 +147,7 @@ public function readCommands() { foreach ($files as $file) { $command = $regex->replace(basename($file), ''); if ($command == 'Plain') continue; - $this->commands[] = \wcf\util\StringUtil::toLowerCase($command); + $this->commands[] = mb_strtolower($command); } $this->commands = array_merge($this->commands, array_keys(\chat\system\command\CommandHandler::getAliasMap())); diff --git a/file/lib/system/command/CommandHandler.class.php b/file/lib/system/command/CommandHandler.class.php index c575e62..ed9e8b1 100644 --- a/file/lib/system/command/CommandHandler.class.php +++ b/file/lib/system/command/CommandHandler.class.php @@ -97,7 +97,7 @@ public function getRoom() { * @return string */ public function getParameters() { - $parts = explode(' ', StringUtil::substring($this->text, StringUtil::length(static::COMMAND_CHAR)), 2); + $parts = explode(' ', mb_substr($this->text, mb_strlen(static::COMMAND_CHAR)), 2); if (!isset($parts[1])) return ''; return $parts[1]; @@ -107,7 +107,7 @@ public function getParameters() { * Loads the command. */ public function loadCommand() { - $parts = explode(' ', StringUtil::substring($this->text, StringUtil::length(static::COMMAND_CHAR)), 2); + $parts = explode(' ', mb_substr($this->text, mb_strlen(static::COMMAND_CHAR)), 2); $class = '\chat\system\command\commands\\'.ucfirst(strtolower($parts[0])).'Command'; if (!class_exists($class)) { diff --git a/file/lib/system/command/commands/AwayCommand.class.php b/file/lib/system/command/commands/AwayCommand.class.php index fb0eff0..3056b01 100644 --- a/file/lib/system/command/commands/AwayCommand.class.php +++ b/file/lib/system/command/commands/AwayCommand.class.php @@ -1,7 +1,6 @@ commandHandler->getParameters()) != 'the fish') { + if (mb_strtolower($this->commandHandler->getParameters()) != 'the fish') { throw new \InvalidArgumentException(); } diff --git a/file/lib/system/command/commands/InfoCommand.class.php b/file/lib/system/command/commands/InfoCommand.class.php index b1f81eb..c51cccc 100644 --- a/file/lib/system/command/commands/InfoCommand.class.php +++ b/file/lib/system/command/commands/InfoCommand.class.php @@ -4,7 +4,6 @@ use \wcf\data\user\User; use \wcf\system\WCF; use \wcf\util\DateUtil; -use \wcf\util\StringUtil; /** * Shows information about the specified user. diff --git a/file/lib/system/command/commands/MeCommand.class.php b/file/lib/system/command/commands/MeCommand.class.php index 9d90113..c14be30 100644 --- a/file/lib/system/command/commands/MeCommand.class.php +++ b/file/lib/system/command/commands/MeCommand.class.php @@ -1,6 +1,5 @@ > 16 & 255).','.($start >> 8 & 255).','.($start & 255).')">'.\wcf\util\StringUtil::encodeHTML($string).''; @@ -87,8 +87,8 @@ public static function gradient($string, $start, $end) { */ public static function str_split($string, $length = 1) { $result = array(); - for ($i = 0, $max = \wcf\util\StringUtil::length($string); $i < $max; $i += $length) { - $result[] = \wcf\util\StringUtil::substring($string, $i, $length); + for ($i = 0, $max = mb_strlen($string); $i < $max; $i += $length) { + $result[] = mb_substr($string, $i, $length); } return $result; }