Whitelist wopi URL for iframes

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
Lukas Reschke 2016-12-07 18:46:52 +01:00
parent 7ff4d5bb52
commit 92a0eed917
No known key found for this signature in database
GPG Key ID: B9F6980CF6E759B1
2 changed files with 12 additions and 2 deletions

View File

@ -22,7 +22,8 @@
namespace OCA\Richdocuments\AppInfo;
//Script for registering file actions
use OC\Security\CSP\ContentSecurityPolicy;
$eventDispatcher = \OC::$server->getEventDispatcher();
$eventDispatcher->addListener(
'OCA\Files::loadAdditionalScripts',
@ -47,5 +48,14 @@ if (class_exists('\OC\Files\Type\TemplateManager')) {
$manager->registerTemplate('application/vnd.openxmlformats-officedocument.presentationml.presentation', 'apps/richdocuments/assets/pptxtemplate.pptx');
}
// Whitelist the wopi URL for iframes, required for Firefox
$wopiUrl = \OC::$server->getConfig()->getAppValue('richdocuments', 'wopi_url');
if ($wopiUrl !== '') {
$manager = \OC::$server->getContentSecurityPolicyManager();
$policy = new ContentSecurityPolicy();
$policy->addAllowedFrameDomain($wopiUrl);
$manager->addDefaultPolicy($policy);
}
// Listen to delete file signal
\OCP\Util::connectHook('OC_Filesystem', 'delete', "OCA\Richdocuments\Storage", "onDelete");

View File

@ -5,7 +5,7 @@
<description>Collabora Online allows you to to work with all kinds of office documents directly in your browser. This application requires Collabora Cloudsuite to be installed on one of your servers, please read the documentation to learn more about that.</description>
<summary>Edit office documents directly in your browser.</summary>
<licence>AGPL</licence>
<version>1.1.22</version>
<version>1.1.23</version>
<author>Collabora Productivity based on work of Frank Karlitschek, Victor Dubiniuk</author>
<bugs>https://github.com/nextcloud/richdocuments/issues</bugs>
<repository type="git">https://github.com/nextcloud/richdocuments.git</repository>