summaryrefslogtreecommitdiff
path: root/include/functions2.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2015-06-08 14:18:49 +0300
committerAndrew Dolgov <[email protected]>2015-06-08 14:18:49 +0300
commitdd6e2386fd0c7f751a79b503c7ed39f14179112c (patch)
treee2a5ca6b204b2011558f806e22f6e0ae57a86c9c /include/functions2.php
parent415a3b50c9879027d5367696ef2b21200cbd5827 (diff)
fix_url: support schema-less urls
Diffstat (limited to 'include/functions2.php')
-rw-r--r--include/functions2.php6
1 files changed, 6 insertions, 0 deletions
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:') {