Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArsentiy Milchakov <milcars@mapswithme.com>2017-11-28 16:11:06 +0300
committerIlya Zverev <ilya@zverev.info>2017-11-28 16:21:06 +0300
commit6482843cb0afec52d8cfd057b21788b6008666cc (patch)
tree86c1d5438f57f0b153442c3cd14e5c3ca7fc06b0 /indexer
parent9f63e855b923d90fe5d8b5e84a4e16db5c597e8a (diff)
[editor] name validation fix - # and № are allowed
Diffstat (limited to 'indexer')
-rw-r--r--indexer/editable_map_object.cpp4
-rw-r--r--indexer/indexer_tests/editable_map_object_test.cpp8
2 files changed, 6 insertions, 6 deletions
diff --git a/indexer/editable_map_object.cpp b/indexer/editable_map_object.cpp
index 3c1b3d123a..82728b3f1d 100644
--- a/indexer/editable_map_object.cpp
+++ b/indexer/editable_map_object.cpp
@@ -768,13 +768,13 @@ bool EditableMapObject::ValidateName(string const & name)
return true;
if (strings::IsASCIIString(name))
- return regex_match(name, regex(R"(^[ A-Za-z0-9.,?!@$%()\-:;"'`]+$)"));
+ return regex_match(name, regex(R"(^[ A-Za-z0-9.,?!@#$%()\-:;"'`]+$)"));
std::wstring_convert<std::codecvt_utf8<char32_t>, char32_t> converter;
std::u32string const u32name = converter.from_bytes(name);
- 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 2edb50d1aa..910f82e95d 100644
--- a/indexer/indexer_tests/editable_map_object_test.cpp
+++ b/indexer/indexer_tests/editable_map_object_test.cpp
@@ -191,11 +191,11 @@ UNIT_TEST(EditableMapObject_ValidateEmail)
UNIT_TEST(EditableMapObject_ValidateName)
{
vector<string> correctNames = {"abc", "абв", "ᆺᆯㅕ", "꫞ꪺꫀꪸ", "a b?c", "a!b.c", "a(b)c", "a,b.c",
- "a$bc", "a%bc", };
+ "a$bc", "a%bc", "a#bc", "a№bc"};
vector<string> incorrectNames = {"a^bc", "a~bc", "a§bc", "a>bc", "a<bc", "a{bc", "a[bc", "*",
- "a*bc", "a=bc", "a_bc", "a#bc", "a№bc", "a±bc", "a\nbc", "a\tbc",
- "a\rbc", "a\vbc", "a\fbc", "a|bc", "N√",
- "Hello World!\U0001F600", "Exit →", "∫0dx = C", "\U0001210A"};
+ "a*bc", "a=bc", "a_bc", "a±bc", "a\nbc", "a\tbc", "a\rbc",
+ "a\vbc", "a\fbc", "a|bc", "N√", "Hello World!\U0001F600",
+ "Exit →", "∫0dx = C", "\U0001210A"};
for (auto const & name : correctNames)
{