diff --git a/appinfo/info.xml b/appinfo/info.xml index eaa82a7..c0365e9 100755 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -4,7 +4,7 @@ Piwik Tracking Track users with piwik Track users with piwik - 0.3.0 + 0.3.1 agpl Klaus Herberth tools diff --git a/appinfo/version b/appinfo/version index 0d91a54..9e11b32 100644 --- a/appinfo/version +++ b/appinfo/version @@ -1 +1 @@ -0.3.0 +0.3.1 diff --git a/build/appinfo/app.php b/build/appinfo/app.php index ce3f9df..7c1346a 100644 --- a/build/appinfo/app.php +++ b/build/appinfo/app.php @@ -16,12 +16,16 @@ $piwik = json_decode(OCP\Config::getAppValue('piwik', 'piwik')); $url = parse_url($piwik->url, PHP_URL_HOST); - if (array_key_exists('HTTP_HOST', $_SERVER) && $_SERVER['HTTP_HOST'] !== $url) { - $policy = new OCP\AppFramework\Http\ContentSecurityPolicy (); + $policy = new OCP\AppFramework\Http\ContentSecurityPolicy (); + $policy->addAllowedScriptDomain('\'self\''); + $policy->addAllowedImageDomain('\'self\''); + + if ($url !== false && array_key_exists('HTTP_HOST', $_SERVER) && $_SERVER['HTTP_HOST'] !== $url) { $policy->addAllowedScriptDomain($url); $policy->addAllowedImageDomain($url); - \OC::$server->getContentSecurityPolicyManager()->addDefaultPolicy($policy); } + + \OC::$server->getContentSecurityPolicyManager()->addDefaultPolicy($policy); } OCP\Util::addScript ( 'piwik', 'track' ); diff --git a/build/appinfo/info.xml b/build/appinfo/info.xml index eaa82a7..c0365e9 100644 --- a/build/appinfo/info.xml +++ b/build/appinfo/info.xml @@ -4,7 +4,7 @@ Piwik Tracking Track users with piwik Track users with piwik - 0.3.0 + 0.3.1 agpl Klaus Herberth tools diff --git a/build/appinfo/version b/build/appinfo/version index 0d91a54..9e11b32 100644 --- a/build/appinfo/version +++ b/build/appinfo/version @@ -1 +1 @@ -0.3.0 +0.3.1 diff --git a/build/js/settings-admin.js b/build/js/settings-admin.js index fbf73cd..19d081b 100644 --- a/build/js/settings-admin.js +++ b/build/js/settings-admin.js @@ -1,5 +1,5 @@ /*! - * owncloud_piwik v0.3.0 - 2017-05-29 + * owncloud_piwik v0.3.1 - 2017-05-30 * * Copyright (c) 2017 Klaus Herberth
* Released under the MIT license @@ -7,7 +7,7 @@ * Please see https://github.com/sualko/owncloud_piwik * * @author Klaus Herberth - * @version 0.3.0 + * @version 0.3.1 * @license MIT */ diff --git a/build/js/track.js b/build/js/track.js index d52af12..72915b0 100644 --- a/build/js/track.js +++ b/build/js/track.js @@ -1,5 +1,5 @@ /*! - * owncloud_piwik v0.3.0 - 2017-05-29 + * owncloud_piwik v0.3.1 - 2017-05-30 * * Copyright (c) 2017 Klaus Herberth
* Released under the MIT license @@ -7,7 +7,7 @@ * Please see https://github.com/sualko/owncloud_piwik * * @author Klaus Herberth - * @version 0.3.0 + * @version 0.3.1 * @license MIT */ diff --git a/package.json b/package.json index 5003698..789d650 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "owncloud_piwik", - "version": "0.3.0", + "version": "0.3.1", "description": "Track owncloud/nextcloud users with piwik", "repository": { "type": "git",