Fix for localization URI ended with '/'
authorMarcin Kaminski <marcin.ka@samsung.com>
Fri, 26 Oct 2012 09:00:37 +0000 (11:00 +0200)
committerGerrit Code Review <gerrit2@kim11>
Fri, 2 Nov 2012 04:51:59 +0000 (13:51 +0900)
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

index c0ddc01..bb19521 100644 (file)
@@ -55,6 +55,8 @@ DPL::Optional<std::string> GetFilePathInWidgetPackageInternal(
     if (filePath.size() == 0) { return DPL::Optional<std::string>::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<std::string>::Null; }