Whitelist wopi URL for iframes

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
pull/8/head 1.1.23
Lukas Reschke 8 years ago
parent 7ff4d5bb52
commit 92a0eed917
No known key found for this signature in database
GPG Key ID: B9F6980CF6E759B1

@ -22,7 +22,8 @@
namespace OCA\Richdocuments\AppInfo; namespace OCA\Richdocuments\AppInfo;
//Script for registering file actions use OC\Security\CSP\ContentSecurityPolicy;
$eventDispatcher = \OC::$server->getEventDispatcher(); $eventDispatcher = \OC::$server->getEventDispatcher();
$eventDispatcher->addListener( $eventDispatcher->addListener(
'OCA\Files::loadAdditionalScripts', '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'); $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 // Listen to delete file signal
\OCP\Util::connectHook('OC_Filesystem', 'delete', "OCA\Richdocuments\Storage", "onDelete"); \OCP\Util::connectHook('OC_Filesystem', 'delete', "OCA\Richdocuments\Storage", "onDelete");

@ -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> <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> <summary>Edit office documents directly in your browser.</summary>
<licence>AGPL</licence> <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> <author>Collabora Productivity based on work of Frank Karlitschek, Victor Dubiniuk</author>
<bugs>https://github.com/nextcloud/richdocuments/issues</bugs> <bugs>https://github.com/nextcloud/richdocuments/issues</bugs>
<repository type="git">https://github.com/nextcloud/richdocuments.git</repository> <repository type="git">https://github.com/nextcloud/richdocuments.git</repository>

Loading…
Cancel
Save