Fixed tabs and spaces.

This commit is contained in:
Kasen IO 2020-01-06 08:29:01 -05:00
parent fb5dbfc52a
commit 8124b7d4a1

View file

@ -2363,7 +2363,7 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co
}
}
else {
// ENTITY SCRIPT WHITELIST STARTS HERE
// ENTITY SCRIPT WHITELIST STARTS HERE
QString whitelistPrefix = "[WHITELIST ENTITY SCRIPTS]";
QList<QString> safeURLS = { "" };
safeURLS += qEnvironmentVariable("EXTRA_WHITELIST").trimmed().split(QRegExp("\\s*,\\s*"), QString::SkipEmptyParts);
@ -2378,16 +2378,16 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co
bool isInWhitelist = false; // assume unsafe
if(ScriptEngine::getContext() == "entity_server") {
if (ScriptEngine::getContext() == "entity_server") {
isInWhitelist = true;
} else {
for (const auto& str : safeURLS) {
qCDebug(scriptengine) << whitelistPrefix << "Script URL: " << scriptOrURL << "TESTING AGAINST" << str << "RESULTS IN"
<< scriptOrURL.startsWith(str);
<< scriptOrURL.startsWith(str);
if (!str.isEmpty() && scriptOrURL.startsWith(str)) {
isInWhitelist = true;
qCDebug(scriptengine) << whitelistPrefix << "Script approved.";
break; // bail early since we found a match
break; // bail early since we found a match
}
}
}