From: Tomasz Iwanek Date: Fri, 5 Apr 2013 09:22:18 +0000 (+0200) Subject: URL localization fix - ver 2 X-Git-Tag: submit/tizen_2.2/20130927.091100^2~112 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4b65fececadabd3cd90b086d5830251e7ae0126b;p=platform%2Fframework%2Fweb%2Fwrt-commons.git URL localization fix - ver 2 [Issue#] N/A [Bug] webkit callbacks returns URL with query and fragment identifier for app:// scheme. It should be skipped for file resolution [Cause] N/A [Solution] Skipped part of URL for file path resolution and appendin it back [Verification] Run widget that uses link with query part and fragment part. Page should be loaded when URL with fragment part is given. Use wrt with app:// scheme ENABLED Change-Id: Ie71e2fe4f421165d2677f72e9ef21c69b0ad73d9 --- diff --git a/modules/localization/src/w3c_file_localization.cpp b/modules/localization/src/w3c_file_localization.cpp index 85ac27e..152440e 100755 --- a/modules/localization/src/w3c_file_localization.cpp +++ b/modules/localization/src/w3c_file_localization.cpp @@ -141,6 +141,21 @@ DPL::Optional getFilePathInWidgetPackageFromUrl( { DPL::String req = url; + DPL::String suffix; + DPL::String::size_type pos = req.find_first_of('#'); + if(pos != DPL::String::npos) + { + suffix = req.substr(pos) + suffix; + req.resize(pos); //truncate fragment identifier + } + + pos = req.find_first_of('?'); + if(pos != DPL::String::npos) + { + suffix = req.substr(pos) + suffix; + req.resize(pos); //truncate query string + } + if (req.find(WIDGET_URI_BEGIN) == 0) { req.erase(0, WIDGET_URI_BEGIN.length()); } else if (req.find(FILE_URI_BEGIN) == 0) { @@ -182,7 +197,7 @@ DPL::Optional getFilePathInWidgetPackageFromUrl( return DPL::Optional::Null; } - found = widgetPath + *found; + found = widgetPath + *found + suffix; return found; }