Skip to content

Commit

Permalink
Whitelist wopi URL for iframes
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
  • Loading branch information
LukasReschke committed Dec 7, 2016
1 parent 7ff4d5b commit 92a0eed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion appinfo/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -47,5 +48,14 @@ function() {
$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");
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 92a0eed

Please sign in to comment.