| Index: src/plugin/PluginFilter.cpp |
| =================================================================== |
| --- a/src/plugin/PluginFilter.cpp |
| +++ b/src/plugin/PluginFilter.cpp |
| @@ -532,7 +532,7 @@ |
| { |
| #ifdef ENABLE_DEBUG_RESULT |
| DEBUG_HIDE_EL(indent + "HideEl::Found (tag/id) filter:" + idIt->second.m_filterText) |
| - CPluginDebug::DebugResultHiding(tagCString, "id:" + id, idIt->second.m_filterText); |
| + CPluginDebug::DebugResultHiding(tagCString, L"id:" + id, idIt->second.m_filterText); |
| #endif |
| return true; |
| } |
| @@ -546,7 +546,7 @@ |
| { |
| #ifdef ENABLE_DEBUG_RESULT |
| DEBUG_HIDE_EL(indent + "HideEl::Found (?/id) filter:" + idIt->second.m_filterText) |
| - CPluginDebug::DebugResultHiding(tagCString, "id:" + id, idIt->second.m_filterText); |
| + CPluginDebug::DebugResultHiding(tagCString, L"id:" + id, idIt->second.m_filterText); |
| #endif |
| return true; |
| } |
| @@ -569,7 +569,7 @@ |
| { |
| #ifdef ENABLE_DEBUG_RESULT |
| DEBUG_HIDE_EL(indent + "HideEl::Found (tag/class) filter:" + classIt->second.m_filterText) |
| - CPluginDebug::DebugResultHiding(tagCString, "class:" + className, classIt->second.m_filterText); |
| + CPluginDebug::DebugResultHiding(tagCString, L"class:" + className, classIt->second.m_filterText); |
| #endif |
| return true; |
| } |
| @@ -672,15 +672,16 @@ |
| bool CPluginFilter::ShouldBlock(const std::wstring& src, int contentType, const std::wstring& domain, bool addDebug) const |
| { |
| - CString srcCString = to_CString(src); |
| + CString srcCString = ToCString(src); |
| + srcCString.Trim(); |
|
Oleksandr
2015/01/05 11:55:40
We have TrimString function in shared/Utils.h for
Eric
2015/01/05 16:18:26
Done.
|
| + std::wstring srcTrimmed = ToWstring(srcCString); |
| // We should not block the empty string, so all filtering does not make sense |
| // Therefore we just return |
| - if (srcCString.Trim().IsEmpty()) |
| + if (srcTrimmed.empty()) |
| { |
| return false; |
| } |
| - |
| CPluginSettings* settings = CPluginSettings::GetInstance(); |
| CString type; |
| @@ -696,14 +697,14 @@ |
| } |
| CPluginClient* client = CPluginClient::GetInstance(); |
| - if (client->Matches(to_wstring(srcCString), to_wstring(type), domain)) |
| + if (client->Matches(srcTrimmed, to_wstring(type), domain)) |
| { |
| if (addDebug) |
| { |
| DEBUG_FILTER("Filter::ShouldBlock " + type + " YES") |
| #ifdef ENABLE_DEBUG_RESULT |
| - CPluginDebug::DebugResultBlocking(type, srcCString, domain); |
| + CPluginDebug::DebugResultBlocking(type, srcTrimmed, domain); |
| #endif |
| } |
| return true; |