diff options
author | MaZderMind | 2015-12-28 11:21:51 +0100 |
---|---|---|
committer | MaZderMind | 2015-12-28 11:21:51 +0100 |
commit | d1fdb6237750d0553b26b0726428d28507141aa6 (patch) | |
tree | 94067bab8402865dc0beb9b6bbf05e0256352c2c /lib | |
parent | c16e317e20377ac8084ba06f29174a925f75513c (diff) |
force protocol on urls coming from relive
Diffstat (limited to '')
-rw-r--r-- | lib/helper.php | 8 |
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; |