History

Hard tabs converted to 4 length soft tabs.

Kasen IO committed 6 years ago

Commit 20f54391 parent 8124b7d1 file · +14 −14Browse files

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

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+14−14
@@ -2377,20 +2377,20 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co · 2376 unmodified lines
23772377 // END PULL SAFEURLS FROM INTERFACE.JSON Settings
23782378
23792379 bool isInWhitelist = false; // assume unsafe
2380−
2381− if (ScriptEngine::getContext() == "entity_server") {
2382− isInWhitelist = true;
2383− } else {
2384− for (const auto& str : safeURLS) {
2385− qCDebug(scriptengine) << whitelistPrefix << "Script URL: " << scriptOrURL << "TESTING AGAINST" << str << "RESULTS IN"
2386− << scriptOrURL.startsWith(str);
2387− if (!str.isEmpty() && scriptOrURL.startsWith(str)) {
2388− isInWhitelist = true;
2389− qCDebug(scriptengine) << whitelistPrefix << "Script approved.";
2390− break; // bail early since we found a match
2391− }
2392− }
2393− }
2380+
2381+ if (ScriptEngine::getContext() == "entity_server") {
2382+ isInWhitelist = true;
2383+ } else {
2384+ for (const auto& str : safeURLS) {
2385+ qCDebug(scriptengine) << whitelistPrefix << "Script URL: " << scriptOrURL << "TESTING AGAINST" << str << "RESULTS IN"
2386+ << scriptOrURL.startsWith(str);
2387+ if (!str.isEmpty() && scriptOrURL.startsWith(str)) {
2388+ isInWhitelist = true;
2389+ qCDebug(scriptengine) << whitelistPrefix << "Script approved.";
2390+ break; // bail early since we found a match
2391+ }
2392+ }
2393+ }
23942394
23952395 if (!isInWhitelist) {
23962396 qCDebug(scriptengine) << whitelistPrefix << "(disabled entity script)" << entityID.toString() << scriptOrURL;