diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index c806e0e579..e0f88b1754 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -608,35 +608,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + diff --git a/android/src/app/organicmaps/bookmarks/data/BookmarkManager.java b/android/src/app/organicmaps/bookmarks/data/BookmarkManager.java index b53f5af8af..fc5c10549c 100644 --- a/android/src/app/organicmaps/bookmarks/data/BookmarkManager.java +++ b/android/src/app/organicmaps/bookmarks/data/BookmarkManager.java @@ -444,10 +444,11 @@ public enum BookmarkManager // See IsBadCharForPath() filename = filename.replaceAll("[:/\\\\<>\"|?*]", ""); + final String lowerCaseFilename = filename.toLowerCase(java.util.Locale.ROOT); // Check that filename contains bookmarks extension. for (String ext: BOOKMARKS_EXTENSIONS) { - if (filename.endsWith(ext)) + if (lowerCaseFilename.endsWith(ext)) return filename; } diff --git a/map/bookmark_helpers.cpp b/map/bookmark_helpers.cpp index d1b54efc59..e048edf475 100644 --- a/map/bookmark_helpers.cpp +++ b/map/bookmark_helpers.cpp @@ -206,12 +206,6 @@ void ValidateKmlData(std::unique_ptr & data) } } -// Returns extension with a dot in a lower case. -std::string GetFileExt(std::string const & filePath) -{ - return strings::MakeLowerCase(base::GetFileExtension(filePath)); -} - bool IsBadCharForPath(strings::UniChar c) { if (c < ' ') @@ -245,6 +239,11 @@ std::string RemoveInvalidSymbols(std::string const & name) return strings::ToUtf8(filtered); } +// Returns extension with a dot in a lower case. +std::string GetLowercaseFileExt(std::string const & filePath) +{ + return strings::MakeLowerCase(base::GetFileExtension(filePath)); +} std::string GenerateUniqueFileName(std::string const & path, std::string name, std::string_view ext) { @@ -339,7 +338,7 @@ std::unique_ptr LoadKmlFile(std::string const & file, KmlFileType std::string GetKMLPath(std::string const & filePath) { - std::string const fileExt = GetFileExt(filePath); + std::string const fileExt = GetLowercaseFileExt(filePath); std::string fileSavePath; if (fileExt == kKmlExtension || fileExt == kGpxExtension) { @@ -367,7 +366,7 @@ std::string GetKMLPath(std::string const & filePath) std::string ext; for (size_t i = 0; i < files.size(); ++i) { - ext = GetFileExt(files[i].first); + ext = GetLowercaseFileExt(files[i].first); if (ext == kKmlExtension) { kmlFileName = files[i].first; diff --git a/map/bookmark_helpers.hpp b/map/bookmark_helpers.hpp index e2cabe2a5e..06cc237afe 100644 --- a/map/bookmark_helpers.hpp +++ b/map/bookmark_helpers.hpp @@ -103,6 +103,7 @@ std::unique_ptr LoadKmlFile(std::string const & file, KmlFileType std::unique_ptr LoadKmlData(Reader const & reader, KmlFileType fileType); std::string GetKMLPath(std::string const & filePath); +std::string GetLowercaseFileExt(std::string const & filePath); bool SaveKmlFileSafe(kml::FileData & kmlData, std::string const & file, KmlFileType fileType); bool SaveKmlData(kml::FileData & kmlData, Writer & writer, KmlFileType fileType); diff --git a/map/bookmark_manager.cpp b/map/bookmark_manager.cpp index a07fd33aa7..f4ceac2fc0 100644 --- a/map/bookmark_manager.cpp +++ b/map/bookmark_manager.cpp @@ -1871,7 +1871,7 @@ void BookmarkManager::LoadBookmarkRoutine(std::string const & filePath, bool isT std::string fileSavePath = GetKMLPath(filePath); if (!fileSavePath.empty()) { - auto const ext = base::GetFileExtension(filePath); + auto const ext = GetLowercaseFileExt(filePath); std::unique_ptr kmlData; if (ext == ".kml" || ext == ".kmz") kmlData = LoadKmlFile(fileSavePath, KmlFileType::Text);