diff options
author | sualko <klaus@jsxc.org> | 2019-08-22 14:43:50 +0300 |
---|---|---|
committer | sualko <klaus@jsxc.org> | 2019-08-22 14:43:50 +0300 |
commit | 3232d2dce87d197cb4609aa7aeb6eae0e6ac7de1 (patch) | |
tree | 35ed5205a3f02b1710e4f8b8912b42769158723c | |
parent | ec808c7b66e392135c0b3f0400bb74890a036510 (diff) |
build v0.5.3v0.5.3
-rwxr-xr-x | appinfo/info.xml | 2 | ||||
-rw-r--r-- | build/appinfo/app.php | 24 | ||||
-rw-r--r-- | build/appinfo/info.xml | 4 | ||||
-rw-r--r-- | build/js/track.js | 4 | ||||
-rw-r--r-- | package.json | 2 |
5 files changed, 21 insertions, 15 deletions
diff --git a/appinfo/info.xml b/appinfo/info.xml index a09aa25..caa857f 100755 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -4,7 +4,7 @@ <name>Piwik/Matomo Tracking</name> <summary>Track users with Piwik/Matomo</summary> <description>Track users with Piwik/Matomo</description> - <version>0.5.2</version> + <version>0.5.3</version> <licence>agpl</licence> <author>Klaus Herberth</author> <category>tools</category> diff --git a/build/appinfo/app.php b/build/appinfo/app.php index eeffecb..158a84c 100644 --- a/build/appinfo/app.php +++ b/build/appinfo/app.php @@ -10,18 +10,24 @@ if (!empty($url)) { ], '' ); + $allowedUrl = ' \'self\' '; $parseurl = parse_url($url); - $url = $parseurl['host']; - if (isset($parseurl['port'])) { - $url .= ':' . (string) $parseurl['port']; + + $isHostDifferent = isset($parseurl['host']) && array_key_exists('SERVER_NAME', $_SERVER) && $_SERVER['SERVER_NAME'] !== $parseurl['host']; + $isPortDifferent = isset($parseurl['port']) && array_key_exists('SERVER_PORT', $_SERVER) && $_SERVER['SERVER_PORT'] !== $parseurl['port']; + + if ($isHostDifferent || $isPortDifferent) { + $allowedUrl = $parseurl['host']; + + if (isset($parseurl['port'])) { + $allowedUrl .= ':' . (string) $parseurl['port']; + } } + $policy = new OCP\AppFramework\Http\ContentSecurityPolicy(); - if ($url !== false && array_key_exists('HTTP_HOST', $_SERVER) - && $_SERVER['HTTP_HOST'] !== $url && !empty($url)) { - $policy->addAllowedScriptDomain($url); - $policy->addAllowedImageDomain($url); + $policy->addAllowedScriptDomain($allowedUrl); + $policy->addAllowedImageDomain($allowedUrl); - \OC::$server->getContentSecurityPolicyManager()->addDefaultPolicy($policy); - } + \OC::$server->getContentSecurityPolicyManager()->addDefaultPolicy($policy); } diff --git a/build/appinfo/info.xml b/build/appinfo/info.xml index 04a0739..caa857f 100644 --- a/build/appinfo/info.xml +++ b/build/appinfo/info.xml @@ -4,7 +4,7 @@ <name>Piwik/Matomo Tracking</name> <summary>Track users with Piwik/Matomo</summary> <description>Track users with Piwik/Matomo</description> - <version>0.5.2</version> + <version>0.5.3</version> <licence>agpl</licence> <author>Klaus Herberth</author> <category>tools</category> @@ -14,7 +14,7 @@ <repository type="git">https://github.com/sualko/cloud_piwik.git</repository> <dependencies> - <nextcloud min-version="14" max-version="16"/> + <nextcloud min-version="14" max-version="17"/> </dependencies> <repair-steps> diff --git a/build/js/track.js b/build/js/track.js index ee52f5d..91f11b2 100644 --- a/build/js/track.js +++ b/build/js/track.js @@ -1,5 +1,5 @@ /*! - * cloud_piwik v0.5.2 - 2019-05-06 + * cloud_piwik v0.5.3 - 2019-08-22 * * Copyright (c) 2019 Klaus Herberth <klaus@jsxc.org> <br> * Released under the MIT license @@ -7,7 +7,7 @@ * Please see https://github.com/sualko/cloud_piwik * * @author Klaus Herberth <klaus@jsxc.org> - * @version 0.5.2 + * @version 0.5.3 * @license MIT */ diff --git a/package.json b/package.json index 7382e1c..94c25f3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cloud_piwik", - "version": "0.5.2", + "version": "0.5.3", "description": "Track Nextcloud users with piwik/matomo", "repository": { "type": "git", |