From dd6e2386fd0c7f751a79b503c7ed39f14179112c Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 8 Jun 2015 14:18:49 +0300 Subject: [PATCH] fix_url: support schema-less urls --- include/functions2.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/functions2.php b/include/functions2.php index 314c12873..e212609db 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:') {