Skip to content

Commit 92a0eed

Browse files
committed
Whitelist wopi URL for iframes
Signed-off-by: Lukas Reschke <[email protected]>
1 parent 7ff4d5b commit 92a0eed

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

appinfo/app.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222

2323
namespace OCA\Richdocuments\AppInfo;
2424

25-
//Script for registering file actions
25+
use OC\Security\CSP\ContentSecurityPolicy;
26+
2627
$eventDispatcher = \OC::$server->getEventDispatcher();
2728
$eventDispatcher->addListener(
2829
'OCA\Files::loadAdditionalScripts',
@@ -47,5 +48,14 @@ function() {
4748
$manager->registerTemplate('application/vnd.openxmlformats-officedocument.presentationml.presentation', 'apps/richdocuments/assets/pptxtemplate.pptx');
4849
}
4950

51+
// Whitelist the wopi URL for iframes, required for Firefox
52+
$wopiUrl = \OC::$server->getConfig()->getAppValue('richdocuments', 'wopi_url');
53+
if ($wopiUrl !== '') {
54+
$manager = \OC::$server->getContentSecurityPolicyManager();
55+
$policy = new ContentSecurityPolicy();
56+
$policy->addAllowedFrameDomain($wopiUrl);
57+
$manager->addDefaultPolicy($policy);
58+
}
59+
5060
// Listen to delete file signal
5161
\OCP\Util::connectHook('OC_Filesystem', 'delete', "OCA\Richdocuments\Storage", "onDelete");

appinfo/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<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>
66
<summary>Edit office documents directly in your browser.</summary>
77
<licence>AGPL</licence>
8-
<version>1.1.22</version>
8+
<version>1.1.23</version>
99
<author>Collabora Productivity based on work of Frank Karlitschek, Victor Dubiniuk</author>
1010
<bugs>https://github.com/nextcloud/richdocuments/issues</bugs>
1111
<repository type="git">https://github.com/nextcloud/richdocuments.git</repository>

0 commit comments

Comments
 (0)