Skip to content

Commit

Permalink
fix: add client side check for userslug #8939
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Nov 24, 2020
1 parent 90434a4 commit f20c12e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions public/src/client/register.js
Expand Up @@ -151,12 +151,12 @@ define('forum/register', [
callback = callback || function () {};

var username_notify = $('#username-notify');

if (username.length < ajaxify.data.minimumUsernameLength) {
var userslug = slugify(username);
if (username.length < ajaxify.data.minimumUsernameLength || userslug.length < ajaxify.data.minimumUsernameLength) {
showError(username_notify, '[[error:username-too-short]]');
} else if (username.length > ajaxify.data.maximumUsernameLength) {
showError(username_notify, '[[error:username-too-long]]');
} else if (!utils.isUserNameValid(username) || !slugify(username)) {
} else if (!utils.isUserNameValid(username) || !userslug) {
showError(username_notify, '[[error:invalid-username]]');
} else {
Promise.allSettled([
Expand Down

0 comments on commit f20c12e

Please sign in to comment.