From 65a2672b31dc8d127ec7c94099e6fca9156e38c5 Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Tue, 5 Oct 2021 16:01:03 +0300 Subject: [PATCH] Web: People: Replace RegExp --- .../src/pages/ProfileAction/Section/Body/updateUserForm.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/products/ASC.People/Client/src/pages/ProfileAction/Section/Body/updateUserForm.js b/products/ASC.People/Client/src/pages/ProfileAction/Section/Body/updateUserForm.js index b3b8211f68..0d45a4948c 100644 --- a/products/ASC.People/Client/src/pages/ProfileAction/Section/Body/updateUserForm.js +++ b/products/ASC.People/Client/src/pages/ProfileAction/Section/Body/updateUserForm.js @@ -217,10 +217,13 @@ class UpdateUserForm extends React.Component { let value = event.target.value; let title = event.target.name; - const regexp = /[\[\]\d+=:!@#$%^&*(){}±§<>+;"'~`№,._|\/\\]/g; - if (regexp.test(value)) { + const regexp = /^[\p{L}\p{M}'\-]+$/gu; + const isValid = regexp.test(value); + + if (!isValid) { stateCopy.errors[title] = true; } else { + if (this.state.errors[title]) stateCopy.errors[title] = false; }