From: Tomasz Iwanek Date: Fri, 5 Apr 2013 09:22:18 +0000 (+0200) Subject: URL localization fix X-Git-Tag: 2.2.1_release~9^2~134 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=198681b93f18faaacb156f9c8f0e0c72564ae60c;p=framework%2Fweb%2Fwrt-commons.git URL localization fix [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 [Verification] Run widget that uses link with query part and fragment part. Sub page should be loaded. Use wrt with app:// scheme ENABLED You may use: porucznik:../t.iwanek/testAV2.wgt. Buttons should have round boundings. Css and js resources should be localized properly. Change-Id: I5253a3cea398cbd671a43c91fa55417185da4290 --- diff --git a/modules/localization/src/w3c_file_localization.cpp b/modules/localization/src/w3c_file_localization.cpp index 4bea51f..8c34ce7 100644 --- a/modules/localization/src/w3c_file_localization.cpp +++ b/modules/localization/src/w3c_file_localization.cpp @@ -141,6 +141,18 @@ DPL::Optional getFilePathInWidgetPackageFromUrl( { DPL::String req = url; + DPL::String::size_type pos = req.find_first_of('#'); + if(pos != DPL::String::npos) + { + req.resize(pos); //truncate fragment identifier + } + + pos = req.find_first_of('?'); + if(pos != DPL::String::npos) + { + 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) {