Skip to content

Commit 414f2b8

Browse files
committed
fix
1 parent 30c7e3a commit 414f2b8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

files/lib/system/event/listener/CheckNicknameListener.class.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use GuzzleHttp\Psr7\Request;
66
use Throwable;
7-
use wcf\system\exception\UserInputException;
87
use wcf\system\io\HttpFactory;
98
use wcf\util\JSON;
109

@@ -16,7 +15,7 @@ final class CheckNicknameListener implements IParameterizedEventListener
1615
public function execute($eventObj, $className, $eventName, array &$parameters)
1716
{
1817
$client = HttpFactory::makeClient();
19-
$request = new Request('GET', 'https://localhost/api/check_nickname.php' . \http_build_query([
18+
$request = new Request('GET', 'https://localhost/api/check_nickname.php?' . \http_build_query([
2019
'nickname' => $eventObj->username,
2120
], '', '&'));
2221

@@ -28,8 +27,8 @@ public function execute($eventObj, $className, $eventName, array &$parameters)
2827
// do nothing
2928
}
3029

31-
if (!isset($data['available']) || $data['available']) {
32-
throw new UserInputException('nickname', 'notAvailable');
30+
if (!isset($data['available']) || !$data['available']) {
31+
$eventObj->errorType['username'] = 'notAvailable';
3332
}
3433
}
3534
}

0 commit comments

Comments
 (0)