From a757e61571533acc0dee1b5cff6361ec9cc9bf80 Mon Sep 17 00:00:00 2001 From: Marcin Kaminski Date: Fri, 26 Oct 2012 11:00:37 +0200 Subject: [PATCH] Fix for localization URI ended with '/' After moving start file localization to WebProcess function receives URI ended with '/' what causes localization failures. [Issue#] N/A [Problem] Unexpected '/' at the end of URIs [Cause] N/A [Solution] Additional check and character removal (if needed) [Verification] Build & install package. Run widget and check if URIs are localized properly. Change-Id: I925dd1a10d83ba1d8d42d7bd84096e77f435a798 --- modules/localization/src/w3c_file_localization.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/localization/src/w3c_file_localization.cpp b/modules/localization/src/w3c_file_localization.cpp index c0ddc01..bb19521 100644 --- a/modules/localization/src/w3c_file_localization.cpp +++ b/modules/localization/src/w3c_file_localization.cpp @@ -55,6 +55,8 @@ DPL::Optional GetFilePathInWidgetPackageInternal( if (filePath.size() == 0) { return DPL::Optional::Null; } //Removing preceding '/' if (filePath[0] == '/') { filePath.erase(0, 1); } + // In some cases (start file localization) url has unnecessary "/" at the end + if(filePath[filePath.size()-1] == '/') { filePath.erase(filePath.size()-1, 1); } //Check if string isn't empty if (filePath.size() == 0) { return DPL::Optional::Null; } -- 2.7.4