Skip to content
Permalink
Browse files Browse the repository at this point in the history
Disallow MW-invalid usernames from being picked
  • Loading branch information
Kenny2github committed Aug 28, 2020
1 parent 468cd79 commit 70849ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ScratchLogin.common.php
Expand Up @@ -37,6 +37,7 @@ function topVerifCommenter($req_comment) {
$comments = verifComments();

$matching_comments = array_filter($comments, function(&$comment) use($req_comment) {
if (preg_match('/^_+|_+$|__+/', $comment['author']['username'])) return false;
return stristr($comment['content'], $req_comment);
});
if (empty($matching_comments)) {
Expand Down Expand Up @@ -144,4 +145,4 @@ function doCodeReset($out, $request, $returnto) {
generateNewCodeForSession($request->getSession());
$out->addWikiMsg('scratchlogin-code-reset', $returnto);
}
}
}

0 comments on commit 70849ef

Please sign in to comment.