From e8ed895332f6bd4c614fd6e9234eb59d4c2d060d Mon Sep 17 00:00:00 2001 From: diosmosis Date: Wed, 9 Sep 2015 14:30:44 -0700 Subject: Correctly parse URL schemes in UrlHelper::isLookLikeUrl(). --- core/UrlHelper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/UrlHelper.php') diff --git a/core/UrlHelper.php b/core/UrlHelper.php index 3a550c8eb3..4a0ac0fa0a 100644 --- a/core/UrlHelper.php +++ b/core/UrlHelper.php @@ -107,8 +107,8 @@ class UrlHelper */ public static function isLookLikeUrl($url) { - return preg_match('~^((ftp|news|http|https)?:)?//(.*)$~D', $url, $matches) !== 0 - && strlen($matches[3]) > 0; + return preg_match('~^(([[:alpha:]][[:alnum:]+.-]*)?:)?//(.*)$~D', $url, $matches) !== 0 + && strlen($matches[3]) > 0; } /** -- cgit v1.2.3