From aa1b194f68f73cb3e23d542c37330cf7331347dd Mon Sep 17 00:00:00 2001 From: Harry Bond Date: Tue, 20 Dec 2022 01:25:15 +0000 Subject: [PATCH] =?UTF-8?q?[indexer]=20allow=20names=20to=20contain=20/,\,?= =?UTF-8?q?=C2=B0,[,]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Harry Bond --- indexer/editable_map_object.cpp | 4 ++-- indexer/indexer_tests/editable_map_object_test.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/indexer/editable_map_object.cpp b/indexer/editable_map_object.cpp index af78c34b2f..9f61d8afe5 100644 --- a/indexer/editable_map_object.cpp +++ b/indexer/editable_map_object.cpp @@ -745,7 +745,7 @@ bool EditableMapObject::ValidateName(string const & name) if (strings::IsASCIIString(name)) { - static auto const s_nameRegex = regex(R"(^[ A-Za-z0-9.,?!@#$%&()\-\+:;"'`]+$)"); + static auto const s_nameRegex = regex(R"(^[ A-Za-z0-9.,?!@°#$%&()\-\+\/\\\[\]:;"'`]+$)"); return regex_match(name, s_nameRegex); } @@ -762,7 +762,7 @@ bool EditableMapObject::ValidateName(string const & name) return false; } - std::u32string const excludedSymbols = U"^~§><{}[]*=_±\n\t\r\v\f|√•÷׶°"; + std::u32string const excludedSymbols = U"^~§><{}*=_±\n\t\r\v\f|√•÷׶"; for (auto const ch : u32name) { diff --git a/indexer/indexer_tests/editable_map_object_test.cpp b/indexer/indexer_tests/editable_map_object_test.cpp index 1fd405080e..73593cf5d8 100644 --- a/indexer/indexer_tests/editable_map_object_test.cpp +++ b/indexer/indexer_tests/editable_map_object_test.cpp @@ -199,8 +199,8 @@ UNIT_TEST(EditableMapObject_ValidateEmail) UNIT_TEST(EditableMapObject_ValidateName) { vector correctNames = {"abc", "абв", "ᆺᆯㅕ", "꫞ꪺꫀꪸ", "a b?c", "a!b.c", "a(b)c", "a,b.c", - "a$bc", "a%bc", "a#bc", "a№bc", "c&a"}; - vector incorrectNames = {"a^bc", "a~bc", "a§bc", "a>bc", "a incorrectNames = {"a^bc", "a~bc", "a§bc", "a>bc", "a