History

Merge pull request #13737 from jherico/fix/fb16633_a

Don't allow Web surfaces created by non-client scripts to access files

Sam Gateau committed 8 years ago

Commit c1951da2 parents 243bd5e 8e9c1e526 files · +276 −234Browse files

Showing the changes to interface/src/Application.cpp (1 of 26 files). Show all

Unified · Split

interface/src/Application.cpp+4−3
@@ -6619,11 +6619,12 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEnginePointe · 6618 unmodified lines
6619 scriptEngine->registerGetterSetter("location", LocationScriptingInterface::locationGetter,6619 scriptEngine->registerGetterSetter("location", LocationScriptingInterface::locationGetter,
6620 LocationScriptingInterface::locationSetter);6620 LocationScriptingInterface::locationSetter);
6621 6621
6622 bool clientScript = scriptEngine->isClientScript();
6623 scriptEngine->registerFunction("OverlayWindow", clientScript ? QmlWindowClass::constructor : QmlWindowClass::restricted_constructor);
6622#if !defined(Q_OS_ANDROID)6624#if !defined(Q_OS_ANDROID)
6623 scriptEngine->registerFunction("OverlayWebWindow", QmlWebWindowClass::constructor);6625 scriptEngine->registerFunction("OverlayWebWindow", clientScript ? QmlWebWindowClass::constructor : QmlWebWindowClass::restricted_constructor);
6624#endif6626#endif
6625 scriptEngine->registerFunction("OverlayWindow", QmlWindowClass::constructor);6627 scriptEngine->registerFunction("QmlFragment", clientScript ? QmlFragmentClass::constructor : QmlFragmentClass::restricted_constructor);
6626 scriptEngine->registerFunction("QmlFragment", QmlFragmentClass::constructor);
6627 6628
6628 scriptEngine->registerGlobalObject("Menu", MenuScriptingInterface::getInstance());6629 scriptEngine->registerGlobalObject("Menu", MenuScriptingInterface::getInstance());
6629 scriptEngine->registerGlobalObject("DesktopPreviewProvider", DependencyManager::get<DesktopPreviewProvider>().data());6630 scriptEngine->registerGlobalObject("DesktopPreviewProvider", DependencyManager::get<DesktopPreviewProvider>().data());