Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/plugin/PluginTabBase.cpp

Issue 29351560: Issue 4395 - Setting page is loaded non-populated on some systems
Patch Set: Don't use UrlEscape and just compare unescaped canonical URLs Created Sept. 8, 2016, 2:48 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/shared/Utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/PluginTabBase.cpp
===================================================================
--- a/src/plugin/PluginTabBase.cpp
+++ b/src/plugin/PluginTabBase.cpp
@@ -155,14 +155,13 @@
bool IsOurHtmlFile(const std::wstring& url)
{
// Declared static because the value is derived from an installation directory, which won't change during run-time.
- static auto dir = FileUrl(HtmlFolderPath());
+ static auto dir = CanonicalizeUrl(FileUrl(HtmlFolderPath()));
- dir = EscapeUrl(CanonicalizeUrl(dir));
- std::wstring urlCanonicalized = EscapeUrl(CanonicalizeUrl(url));
+ std::wstring urlCanonical = CanonicalizeUrl(url);
DEBUG_GENERAL([&]() -> std::wstring {
std::wstring log = L"InjectABP. Current URL: ";
- log += urlCanonicalized;
+ log += urlCanonical;
log += L", template directory URL: ";
log += dir;
return log;
@@ -171,17 +170,16 @@
/*
* The length check here is defensive, in case the document URL is truncated for some reason.
*/
- if (urlCanonicalized.length() < 5)
+ if (urlCanonical.length() < 5)
{
// We can't match ".html" at the end of the URL if it's too short.
return false;
}
- auto urlCstr = urlCanonicalized.c_str();
+ auto urlCstr = urlCanonical.c_str();
// Check the prefix to match our directory
// Check the suffix to be an HTML file
- // Compare escaped version and return
return (_wcsnicmp(urlCstr, dir.c_str(), dir.length()) == 0) &&
- (_wcsnicmp(urlCstr + url.length() - 5, L".html", 5) == 0);
+ (_wcsnicmp(urlCstr + urlCanonical.length() - 5, L".html", 5) == 0);
}
}
« no previous file with comments | « no previous file | src/shared/Utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld