}
/**
- * Construct the base URL http[s]://forge_name[:port]
+ * Return URL prefix (http:// or https://)
*
- * @return string base URL
+ * @return string URL prefix
*/
-function util_make_base_url() {
+function util_url_prefix() {
if (forge_get_config('use_ssl')) {
- $url = "https://" ;
+ return "https://";
} else {
- $url = "http://" ;
+ return "http://";
}
+}
+
+/**
+ * Construct the base URL http[s]://forge_name[:port]
+ *
+ * @return string base URL
+ */
+function util_make_base_url() {
+ $url = util_url_prefix();
$url .= forge_get_config('web_host') ;
if (forge_get_config('https_port') && (forge_get_config('https_port') != 443)) {
$url .= ":".forge_get_config('https_port') ;
}
return $url;
}
+
/**
* Construct full URL from a relative path
*