From 4d32551e1f52b949fc4a88d62699c7fdbe8f9954 Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Thu, 5 May 2016 14:39:12 +0200 Subject: [PATCH] Do not match invalid coordinates without decimal dot. --- map/geourl_process.cpp | 2 +- map/map_tests/geourl_test.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/map/geourl_process.cpp b/map/geourl_process.cpp index c309a2c373..a254758ef4 100644 --- a/map/geourl_process.cpp +++ b/map/geourl_process.cpp @@ -112,7 +112,7 @@ namespace url_scheme public: LatLonParser(Info & info) - : m_regexp("-?\\d+\\.?\\d*, *-?\\d+\\.?\\d*") + : m_regexp("-?\\d+\\.{1}\\d*, *-?\\d+\\.{1}\\d*") , m_info(info) , m_latPriority(-1) , m_lonPriority(-1) diff --git a/map/map_tests/geourl_test.cpp b/map/map_tests/geourl_test.cpp index 98df968d51..962091877c 100644 --- a/map/map_tests/geourl_test.cpp +++ b/map/map_tests/geourl_test.cpp @@ -33,6 +33,10 @@ UNIT_TEST(ProcessURL_Smoke) TEST(info.IsValid(), ()); TEST_ALMOST_EQUAL_ULPS(info.m_lat, 32.22, ()); TEST_ALMOST_EQUAL_ULPS(info.m_lon, 123.33, ()); + + info.Reset(); + ParseGeoURL("model: iphone 7,1", info); + TEST(!info.IsValid(), ()); } UNIT_TEST(ProcessURL_Instagram)