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>2018-01-09 15:45:21 +0300
committerIlya Zverev <ilya@zverev.info>2018-01-09 15:52:22 +0300
commit6c899af9e17159b389db138c545ed1d9b2a6b901 (patch)
tree4cf37eb99b099f68cb63f9a842c8007caf2cdd06 /indexer
parentacfbf36c394c6cb17f0004927d633b05f7e9b054 (diff)
[editor] names validation fix
Diffstat (limited to 'indexer')
-rw-r--r--indexer/editable_map_object.cpp2
-rw-r--r--indexer/indexer_tests/editable_map_object_test.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/indexer/editable_map_object.cpp b/indexer/editable_map_object.cpp
index a174ed20e0..e46508c288 100644
--- a/indexer/editable_map_object.cpp
+++ b/indexer/editable_map_object.cpp
@@ -763,7 +763,7 @@ 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;
diff --git a/indexer/indexer_tests/editable_map_object_test.cpp b/indexer/indexer_tests/editable_map_object_test.cpp
index f28591ffa8..ca7f9b2cd2 100644
--- a/indexer/indexer_tests/editable_map_object_test.cpp
+++ b/indexer/indexer_tests/editable_map_object_test.cpp
@@ -190,7 +190,7 @@ 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", "a#bc", "a№bc", "c&a"};
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\nbc", "a\tbc", "a\rbc",
"a\vbc", "a\fbc", "a|bc", "N√", "Hello World!\U0001F600",