diff options
author | mattab <matthieu.aubry@gmail.com> | 2014-12-02 03:46:25 +0300 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2014-12-02 03:47:20 +0300 |
commit | 0c051152b6d7e21450b76dad27ee8accbe8b26a4 (patch) | |
tree | e17632dcffc29a333f5d81bc6f982665d24d6572 /core/UrlHelper.php | |
parent | a0d3bf94837642edafda458546497d703843854b (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.php | 4 |
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; } /** |