Better check if site,server is configured.

This commit is contained in:
Eric Helgeson 2009-10-19 20:08:20 -04:00
parent 66fca9e2a8
commit 490dfc6f5a

View File

@ -760,12 +760,18 @@ function common_path($relative, $ssl=false)
if (is_string(common_config('site', 'sslserver')) &&
mb_strlen(common_config('site', 'sslserver')) > 0) {
$serverpart = common_config('site', 'sslserver');
} else {
} else if (common_config('site', 'server')) {
$serverpart = common_config('site', 'server');
} else {
common_log(LOG_ERR, 'Site Sever not configured, unable to determine site name.');
}
} else {
$proto = 'http';
$serverpart = common_config('site', 'server');
if (common_config('site', 'server')) {
$serverpart = common_config('site', 'server');
} else {
common_log(LOG_ERR, 'Site Sever not configured, unable to determine site name.');
}
}
return $proto.'://'.$serverpart.'/'.$pathpart.$relative;