Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 1 file). Show all
Unified · Split
| @@ -2364,6 +2364,7 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co · 2363 unmodified lines | ||
| 2364 | 2364 | } |
| 2365 | 2365 | else { |
| 2366 | 2366 | // ENTITY SCRIPT WHITELIST STARTS HERE |
| 2367 | + QString whitelistPrefix = "[WHITELIST ENTITY SCRIPTS]"; | |
| 2367 | 2368 | QList<QString> safeURLS = { "" }; |
| 2368 | 2369 | safeURLS += qEnvironmentVariable("EXTRA_WHITELIST").trimmed().split(QRegExp("\\s*,\\s*"), QString::SkipEmptyParts); |
| 2369 | 2370 | |
| @@ -2377,16 +2378,16 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co · 7 unmodified lines | ||
| 2377 | 2378 | |
| 2378 | 2379 | bool isInWhitelist = false; // assume unsafe |
| 2379 | 2380 | for (const auto& str : safeURLS) { |
| 2380 | − qCDebug(scriptengine) << "Script URL: " << scriptOrURL << "TESTING AGAINST" << str << "RESULTS IN" | |
| 2381 | + qCDebug(scriptengine) << whitelistPrefix << "Script URL: " << scriptOrURL << "TESTING AGAINST" << str << "RESULTS IN" | |
| 2381 | 2382 | << scriptOrURL.startsWith(str); |
| 2382 | 2383 | if (!str.isEmpty() && scriptOrURL.startsWith(str)) { |
| 2383 | 2384 | isInWhitelist = true; |
| 2384 | − qCDebug(scriptengine) << "Script approved."; | |
| 2385 | + qCDebug(scriptengine) << whitelistPrefix << "Script approved."; | |
| 2385 | 2386 | break; // bail early since we found a match |
| 2386 | 2387 | } |
| 2387 | 2388 | } |
| 2388 | 2389 | if (!isInWhitelist) { |
| 2389 | − qCDebug(scriptengine) << "(disabled entity script)" << entityID.toString() << scriptOrURL; | |
| 2390 | + qCDebug(scriptengine) << whitelistPrefix << "(disabled entity script)" << entityID.toString() << scriptOrURL; | |
| 2390 | 2391 | exception = makeError("UNSAFE_ENTITY_SCRIPTS == 0"); |
| 2391 | 2392 | } else { |
| 2392 | 2393 | QTimer timeout; |