aboutsummaryrefslogtreecommitdiff
path: root/lib/helper.php
diff options
context:
space:
mode:
authorMaZderMind2015-07-03 13:20:35 +0200
committerMaZderMind2015-07-03 13:20:35 +0200
commit01510fa8bdd2f5920a1121b2b7f7b5a2487623e1 (patch)
treea613ccaa7f0050fdbeaf6ebd10f2047247e8b769 /lib/helper.php
parentb2cdfa500fa2ae85079e61be4a767b2960e47601 (diff)
Auto-Prepend protocoll for protocol-relative Base-URLs
This allows to have a switching button
Diffstat (limited to 'lib/helper.php')
-rw-r--r--lib/helper.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/helper.php b/lib/helper.php
index 4cf089f..711ac6a 100644
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -13,7 +13,13 @@ function proto()
function baseurl()
{
if(isset($GLOBALS['CONFIG']['BASEURL']))
- return $GLOBALS['CONFIG']['BASEURL'];
+ {
+ $base = $GLOBALS['CONFIG']['BASEURL'];
+ if(startswith('//', $base))
+ $base = proto().':'.$base;
+
+ return $base;
+ }
$base = ssl() ? 'https://' : 'http://';
$base .= $_SERVER['HTTP_HOST'];