summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'shared/functions/url.php')
-rw-r--r--shared/functions/url.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/shared/functions/url.php b/shared/functions/url.php
index 0234b2b..b8e5c31 100644
--- a/shared/functions/url.php
+++ b/shared/functions/url.php
@@ -2,22 +2,23 @@
// Makes all URLs absolute
function url($url='') {
global $S;
+ $base=isset($S['url'])?$S['url']:$S['conf']['url'];
if (strlen($url) == 0) {
- return $S['conf']['url'].($S['conf']['mod_rewrite']?'':'/index.php');
+ return $base.($S['conf']['mod_rewrite']?'':'/index.php');
} elseif (substr($url, 0, 7) == 'http://') {
return $url;
}
if ($S['conf']['mod_rewrite']) {
- return $S['conf']['url'].'/'.$url;
+ return $base.'/'.$url;
} else {
if (strpos($url, '?')) {
$q=substr($url, strpos($url, '?')+1);
$url=substr($url, 0, strpos($url, '?'));
}
if (strlen($url)) {
- return $S['conf']['url'].'/index.php?req='.$url.(isset($q)?'&'.$q:'');
+ return $base.'/index.php?req='.$url.(isset($q)?'&'.$q:'');
} else {
- return $S['conf']['url'].'/index.php?'.$q;
+ return $base.'/index.php?'.$q;
}
}
}