Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 1 file). Show all
Unified · Split
| @@ -2377,20 +2377,20 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co · 2376 unmodified lines | |||
| 2377 | // END PULL SAFEURLS FROM INTERFACE.JSON Settings | 2377 | // END PULL SAFEURLS FROM INTERFACE.JSON Settings |
| 2378 | 2378 | ||
| 2379 | bool isInWhitelist = false; // assume unsafe | 2379 | bool isInWhitelist = false; // assume unsafe |
| 2380 | 2380 | ||
| 2381 | if (ScriptEngine::getContext() == "entity_server") { | 2381 | if (ScriptEngine::getContext() == "entity_server") { |
| 2382 | isInWhitelist = true; | 2382 | isInWhitelist = true; |
| 2383 | } else { | 2383 | } else { |
| 2384 | for (const auto& str : safeURLS) { | 2384 | for (const auto& str : safeURLS) { |
| 2385 | qCDebug(scriptengine) << whitelistPrefix << "Script URL: " << scriptOrURL << "TESTING AGAINST" << str << "RESULTS IN" | 2385 | qCDebug(scriptengine) << whitelistPrefix << "Script URL: " << scriptOrURL << "TESTING AGAINST" << str << "RESULTS IN" |
| 2386 | << scriptOrURL.startsWith(str); | 2386 | << scriptOrURL.startsWith(str); |
| 2387 | if (!str.isEmpty() && scriptOrURL.startsWith(str)) { | 2387 | if (!str.isEmpty() && scriptOrURL.startsWith(str)) { |
| 2388 | isInWhitelist = true; | 2388 | isInWhitelist = true; |
| 2389 | qCDebug(scriptengine) << whitelistPrefix << "Script approved."; | 2389 | qCDebug(scriptengine) << whitelistPrefix << "Script approved."; |
| 2390 | break; // bail early since we found a match | 2390 | break; // bail early since we found a match |
| 2391 | } | 2391 | } |
| 2392 | } | 2392 | } |
| 2393 | } | 2393 | } |
| 2394 | 2394 | ||
| 2395 | if (!isInWhitelist) { | 2395 | if (!isInWhitelist) { |
| 2396 | qCDebug(scriptengine) << whitelistPrefix << "(disabled entity script)" << entityID.toString() << scriptOrURL; | 2396 | qCDebug(scriptengine) << whitelistPrefix << "(disabled entity script)" << entityID.toString() << scriptOrURL; |