aboutsummaryrefslogtreecommitdiff
path: root/lib/helper.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/helper.php')
-rw-r--r--lib/helper.php8
1 files changed, 8 insertions, 0 deletions
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;