From 3f57d22f33c178e282c99d250f99ee2700dd1551 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Wed, 3 Jul 2019 12:56:50 +0200 Subject: 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. --- plugins/WebsiteMeasurable/Settings/Urls.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3