| 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); |
| } |
| } |