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:
authormattab <matthieu.aubry@gmail.com>2014-12-02 03:46:25 +0300
committermattab <matthieu.aubry@gmail.com>2014-12-02 03:47:20 +0300
commit0c051152b6d7e21450b76dad27ee8accbe8b26a4 (patch)
treee17632dcffc29a333f5d81bc6f982665d24d6572 /core/UrlHelper.php
parenta0d3bf94837642edafda458546497d703843854b (diff)
Accept URLs formatted as //domain/path
Fixes https://github.com/piwik/piwik/pull/6652
Diffstat (limited to 'core/UrlHelper.php')
-rw-r--r--core/UrlHelper.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/UrlHelper.php b/core/UrlHelper.php
index b1dfa46d12..5efba99996 100644
--- a/core/UrlHelper.php
+++ b/core/UrlHelper.php
@@ -101,8 +101,8 @@ class UrlHelper
*/
public static function isLookLikeUrl($url)
{
- return preg_match('~^(ftp|news|http|https)?://(.*)$~D', $url, $matches) !== 0
- && strlen($matches[2]) > 0;
+ return preg_match('~^((ftp|news|http|https)?:)?//(.*)$~D', $url, $matches) !== 0
+ && strlen($matches[3]) > 0;
}
/**