From 93eaf0fdfda3ee1546bf9aeafec5944f8c8d3843 Mon Sep 17 00:00:00 2001 From: Pascal Precht <445106+PascalPrecht@users.noreply.github.com> Date: Mon, 5 Dec 2022 13:26:06 +0100 Subject: [PATCH] fix: allow whitespaces in display and nicknames Closes #8391 --- ui/imports/shared/popups/NicknamePopup.qml | 2 +- ui/imports/utils/Constants.qml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/imports/shared/popups/NicknamePopup.qml b/ui/imports/shared/popups/NicknamePopup.qml index 6db3372199..be73f1f866 100644 --- a/ui/imports/shared/popups/NicknamePopup.qml +++ b/ui/imports/shared/popups/NicknamePopup.qml @@ -63,7 +63,7 @@ StatusModal { validationMode: StatusInput.ValidationMode.IgnoreInvalidInput validators: [ StatusRegularExpressionValidator { - validatorObj: RXValidator { regularExpression: /^[\w\d_-]*$/u } + validatorObj: RXValidator { regularExpression: /^[\w\d_ -]*$/u } validate: function (value) { return validatorObj.test(value) } diff --git a/ui/imports/utils/Constants.qml b/ui/imports/utils/Constants.qml index 8dfb343f23..87d1fb2104 100644 --- a/ui/imports/utils/Constants.qml +++ b/ui/imports/utils/Constants.qml @@ -402,8 +402,8 @@ QtObject { errorMessage: qsTr("Username must be at least 5 characters") }, StatusRegularExpressionValidator { - regularExpression: /^[a-zA-Z0-9\-_]+$/ - errorMessage: qsTr("Only letters, numbers, underscores and hyphens allowed") + regularExpression: /^[a-zA-Z0-9\-_ ]+$/ + errorMessage: qsTr("Only letters, numbers, underscores, whitespaces and hyphens allowed") }, // TODO: Create `StatusMaxLengthValidator` in StatusQ StatusValidator {