Use Regex.test instead of String.match in WCF.Message.js
authorTim Düsterhus <duesterhus@woltlab.com>
Sat, 21 Sep 2013 12:17:14 +0000 (14:17 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Sat, 21 Sep 2013 12:17:14 +0000 (14:17 +0200)
wcfsetup/install/files/js/WCF.Message.js

index f27a3221d227d402f28130d6dcdd60c85cbd3d60..9320f6660631d0b304cfc163f1d64720d0c626d2 100644 (file)
@@ -3130,8 +3130,8 @@ WCF.Message.UserMention = Class.extend({
                $text = '';
                for (var $i = 0; $i < $textBackup.length; $i++) {
                        var $byte = $textBackup.charCodeAt($i).toString(16);
-                       if ($byte != '200b' && !$textBackup.charAt($i).match(/\s/)) {
-                               if ($textBackup[$i] === '@' && $i && $textBackup[$i - 1].match(/\s/)) {
+                       if ($byte != '200b' && !/\s/.test($textBackup[$i])) {
+                               if ($textBackup[$i] === '@' && $i && /\s/.test($textBackup[$i - 1])) {
                                        $text = '';
                                }