From: Andrew Dolgov Date: Mon, 8 Jun 2015 11:18:49 +0000 (+0300) Subject: fix_url: support schema-less urls X-Git-Tag: 16.3~314 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=dd6e2386fd0c7f751a79b503c7ed39f14179112c;p=tt-rss.git fix_url: support schema-less urls --- diff --git a/include/functions2.php b/include/functions2.php index 314c1287..e212609d 100644 --- a/include/functions2.php +++ b/include/functions2.php @@ -1739,6 +1739,12 @@ * @return string Fixed URL. */ function fix_url($url) { + + // support schema-less urls + if (strpos($url, '//') === 0) { + $url = 'https:' . $url; + } + if (strpos($url, '://') === false) { $url = 'http://' . $url; } else if (substr($url, 0, 5) == 'feed:') {