From d1fdb6237750d0553b26b0726428d28507141aa6 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Mon, 28 Dec 2015 11:21:51 +0100 Subject: force protocol on urls coming from relive --- lib/helper.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib') diff --git a/lib/helper.php b/lib/helper.php index 6635fb1..c23d211 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -37,6 +37,14 @@ function forceslash($url) return $url; } +function forceproto($url) +{ + if(startswith('//', $url)) + $url = proto().':'.$url; + + return $url; +} + function startswith($needle, $haystack) { return substr($haystack, 0, strlen($needle)) == $needle; -- cgit v1.2.3