Fixed username validation in guest posting
authorMarcel Werk <burntime@woltlab.com>
Sun, 23 Apr 2017 10:04:35 +0000 (12:04 +0200)
committerMarcel Werk <burntime@woltlab.com>
Sun, 23 Apr 2017 10:04:35 +0000 (12:04 +0200)
wcfsetup/install/files/lib/data/TMessageQuickReplyGuestDialogAction.class.php
wcfsetup/install/files/lib/data/comment/CommentAction.class.php

index f0dc033c35e0de4dea68e3fa2d9317d64b3694d5..5213b38040c6fe77d649225a31642a34a97cffc2 100644 (file)
@@ -5,6 +5,7 @@ use wcf\system\captcha\CaptchaHandler;
 use wcf\system\captcha\ICaptchaHandler;
 use wcf\system\exception\UserInputException;
 use wcf\system\WCF;
+use wcf\util\UserRegistrationUtil;
 use wcf\util\UserUtil;
 
 /**
@@ -106,7 +107,7 @@ trait TMessageQuickReplyGuestDialogAction {
                try {
                        $this->readString('username', false, 'data');
                        
-                       if (!UserUtil::isValidUsername($this->parameters['data']['username'])) {
+                       if (!UserRegistrationUtil::isValidUsername($this->parameters['data']['username'])) {
                                throw new UserInputException('username', 'invalid');
                        }
                        if (!UserUtil::isAvailableUsername($this->parameters['data']['username'])) {
index d9c65eab36b25a219c584b7ed548062c0fa8ca7b..cf57baef0d54d5f0df6b49924bd80c71747f20b4 100644 (file)
@@ -23,6 +23,7 @@ use wcf\system\user\notification\object\CommentUserNotificationObject;
 use wcf\system\user\notification\UserNotificationHandler;
 use wcf\system\WCF;
 use wcf\util\MessageUtil;
+use wcf\util\UserRegistrationUtil;
 use wcf\util\UserUtil;
 
 /**
@@ -778,7 +779,7 @@ class CommentAction extends AbstractDatabaseObjectAction {
                try {
                        $this->readString('username', false, 'data');
                        
-                       if (!UserUtil::isValidUsername($this->parameters['data']['username'])) {
+                       if (!UserRegistrationUtil::isValidUsername($this->parameters['data']['username'])) {
                                throw new UserInputException('username', 'invalid');
                        }
                        if (!UserUtil::isAvailableUsername($this->parameters['data']['username'])) {