| Left: | ||
| Right: |
| OLD | NEW |
|---|---|
| 1 #include "PluginStdAfx.h" | 1 #include "PluginStdAfx.h" |
| 2 | 2 |
| 3 // Internet / FTP | 3 // Internet / FTP |
| 4 #include <wininet.h> | 4 #include <wininet.h> |
| 5 | 5 |
| 6 // IP adapter | 6 // IP adapter |
| 7 #include <iphlpapi.h> | 7 #include <iphlpapi.h> |
| 8 | 8 |
| 9 #include "PluginSettings.h" | 9 #include "PluginSettings.h" |
| 10 #include "PluginSystem.h" | 10 #include "PluginSystem.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 148 | 148 |
| 149 hasError = true; | 149 hasError = true; |
| 150 | 150 |
| 151 s_pluginErrors.erase(it); | 151 s_pluginErrors.erase(it); |
| 152 } | 152 } |
| 153 } | 153 } |
| 154 s_criticalSectionLocal.Unlock(); | 154 s_criticalSectionLocal.Unlock(); |
| 155 | 155 |
| 156 return hasError; | 156 return hasError; |
| 157 } | 157 } |
| 158 | |
| 159 // ============================================================================ | |
| 160 // Whitelisting | |
| 161 // ============================================================================ | |
| 162 | |
| 163 #ifdef SUPPORT_WHITELIST | |
| 164 | |
| 165 bool CPluginClientBase::IsUrlWhiteListed(const CString& url) | |
| 166 { | |
| 167 if (url.IsEmpty()) | |
| 168 { | |
| 169 return false; | |
| 170 } | |
| 171 | |
| 172 int pos = 0; | |
| 173 CString scheme = url.Find('/',pos) >= 0 ? url.Tokenize(L"/", pos) : L""; | |
| 174 CString domain = ExtractDomain(url); | |
| 175 if (scheme == L"res:" || scheme == L"file:") | |
|
Felix Dahlke
2013/06/25 09:46:58
Do you think excluding some schemes is still neces
Wladimir Palant
2013/06/25 12:00:40
Yes, leaving it to Matches() is more consistent to
Oleksandr
2013/06/25 12:13:58
We should do as little as possible with these. Esp
| |
| 176 { | |
| 177 return true; | |
| 178 } | |
| 179 | |
| 180 // TODO: Caching whitelist entries in PluginSettings is redundant and wasteful . We should have an engine call for IsWhitelistedDomain. | |
| 181 CPluginSettings* pluginSettings = CPluginSettings::GetInstance(); | |
| 182 pluginSettings->RefreshWhitelist(); | |
| 183 return pluginSettings->IsWhiteListedDomain(domain); | |
| 184 } | |
| 185 | |
| 186 #endif // SUPPORT_WHITELIST | |
| OLD | NEW |