History

Lint

Kasen IO committed 6 years ago

Commit 428a5b61 parent 8b03d1b2 files · +125 −125Browse files

Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 2 files). Show all

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+8−8
@@ -2369,20 +2369,20 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co · 2368 unmodified lines
23692369 QList<QString> safeURLPrefixes = { "file:///", "atp:", "cache:" };
23702370 safeURLPrefixes += qEnvironmentVariable("EXTRA_WHITELIST").trimmed().split(QRegExp("\\s*,\\s*"), QString::SkipEmptyParts);
23712371
2372− // ENTITY SCRIPT WHITELIST TOGGLE CHECK
2372+ // Entity Script Whitelist toggle check.
23732373 Setting::Handle<bool> whitelistEnabled {"private/whitelistEnabled", false };
23742374
23752375 if (!whitelistEnabled.get()) {
23762376 passList = true;
23772377 }
23782378
2379− // PULL SAFEURLS FROM INTERFACE.JSON Settings
2379+ // Pull SAFEURLS from the Interface.JSON settings.
23802380 QVariant raw = Setting::Handle<QVariant>("private/settingsSafeURLS").get();
23812381 QStringList settingsSafeURLS = raw.toString().trimmed().split(QRegExp("\\s*[,\r\n]+\\s*"), QString::SkipEmptyParts);
23822382 safeURLPrefixes += settingsSafeURLS;
2383− // END PULL SAFEURLS FROM INTERFACE.JSON Settings
2383+ // END Pull SAFEURLS from the Interface.JSON settings.
23842384
2385− // GET CURRENT DOMAIN WHITELIST BYPASS, IN CASE AN ENTIRE DOMAIN IS WHITELISTED
2385+ // Get current domain whitelist bypass, in case an entire domain is whitelisted.
23862386 QString currentDomain = DependencyManager::get<AddressManager>()->getDomainURL().host();
23872387
23882388 QString domainSafeIP = nodeList->getDomainHandler().getHostname();
@@ -2395,9 +2395,9 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co · 6 unmodified lines
23952395 passList = true;
23962396 }
23972397 }
2398− // END CURRENT DOMAIN WHITELIST BYPASS
2398+ // END bypass whitelist based on current domain.
23992399
2400− // START CHECKING AGAINST THE WHITELIST
2400+ // Start processing scripts through the whitelist.
24012401 if (ScriptEngine::getContext() == "entity_server") { // If running on the server, do not engage whitelist.
24022402 passList = true;
24032403 } else if (!passList) { // If waved through, do not engage whitelist.
@@ -2407,11 +2407,11 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co · 3 unmodified lines
24072407 if (!str.isEmpty() && scriptOrURL.startsWith(str)) {
24082408 passList = true;
24092409 qCDebug(scriptengine) << whitelistPrefix << "Script approved.";
2410− break; // bail early since we found a match
2410+ break; // Bail early since we found a match.
24112411 }
24122412 }
24132413 }
2414− // END CHECKING AGAINST THE WHITELIST
2414+ // END processing of scripts through the whitelist.
24152415
24162416 if (!passList) { // If the entity failed to pass for any reason, it's blocked and an error is thrown.
24172417 qCDebug(scriptengine) << whitelistPrefix << "(disabled entity script)" << entityID.toString() << scriptOrURL;