Cleanup excess code and gURLProtocolWhitelist, add isWhitelistedProtocol()

# Conflicts:
#	indra/llwindow/llwindowmacosx.cpp
#	indra/llwindow/llwindowsdl2.cpp
This commit is contained in:
Lirusaito
2019-03-19 02:41:31 -04:00
parent 627c0a6b57
commit 45228f920d
5 changed files with 705 additions and 2450 deletions

View File

@@ -2476,18 +2476,7 @@ void exec_cmd(const std::string& cmd, const std::string& arg)
// Must begin with protocol identifier.
void LLWindowSDL::spawnWebBrowser(const std::string& escaped_url, bool async)
{
bool found = false;
S32 i;
for (i = 0; i < gURLProtocolWhitelistCount; i++)
{
if (escaped_url.find(gURLProtocolWhitelist[i]) != std::string::npos)
{
found = true;
break;
}
}
if (!found)
if (!isWhitelistedProtocol(escaped_url))
{
LL_WARNS() << "spawn_web_browser called for url with protocol not on whitelist: " << escaped_url << LL_ENDL;
return;