Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <tsteur@users.noreply.github.com>2019-07-03 13:56:50 +0300
committerGitHub <noreply@github.com>2019-07-03 13:56:50 +0300
commit3f57d22f33c178e282c99d250f99ee2700dd1551 (patch)
tree977fc28f247a18549bec4b6c6c49d0215486cfe3
parent0969b1dc1b2c27f34a638db93b216a705f6b2cdc (diff)
If URL starts with // in sites manager, only prepend http: instead of http:// (#14616)
fix https://github.com/matomo-org/matomo/issues/14615 alternatively we could throw an exception if URL starts with `//`. Configuring a URL with `//` is not supported currently.
-rw-r--r--plugins/WebsiteMeasurable/Settings/Urls.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/WebsiteMeasurable/Settings/Urls.php b/plugins/WebsiteMeasurable/Settings/Urls.php
index 5b63440be0..7274b33694 100644
--- a/plugins/WebsiteMeasurable/Settings/Urls.php
+++ b/plugins/WebsiteMeasurable/Settings/Urls.php
@@ -115,7 +115,11 @@ class Urls extends \Piwik\Settings\Measurable\MeasurableProperty
if (empty($scheme)
&& strpos($url, '://') === false
) {
- $url = 'http://' . $url;
+ if (strpos($url, '//') === 0) {
+ $url = 'http:' . $url;
+ } else {
+ $url = 'http://' . $url;
+ }
}
$url = trim($url);
$url = Common::sanitizeInputValue($url);