mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-10-13 18:04:54 +02:00
Using a config variable to define protocol and domain name instead of $_SERVER as it seems inconsistent. fix #182 and #225
This commit is contained in:
@@ -116,11 +116,8 @@ function calculate_discount($orig, $new) {
|
||||
|
||||
// Proper URLs
|
||||
function url($path = false) {
|
||||
$protocol = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://';
|
||||
$domain = $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] != 80 ? ':' . $_SERVER['SERVER_PORT'] : null);
|
||||
$folder = dirname($_SERVER['SCRIPT_NAME']);
|
||||
|
||||
return $protocol . $domain . ($folder == '/' ? '' : $folder) . '/' . $path;
|
||||
return config('site_url') . '/' . $path;
|
||||
}
|
||||
|
||||
function getCache() {
|
||||
|
Reference in New Issue
Block a user