mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-05-01 11:49:21 +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:
parent
ee11674450
commit
0dc15ea95b
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
$config['site_title'] = 'Znote AAC';
|
$config['site_title'] = 'Znote AAC';
|
||||||
$config['site_title_context'] = 'Because open communities are good communities. :3';
|
$config['site_title_context'] = 'Because open communities are good communities. :3';
|
||||||
|
$config['site_url'] = "http://znote.dev";
|
||||||
|
|
||||||
// Path to server folder without / Example: C:\Users\Alvaro\Documents\GitHub\forgottenserver
|
// Path to server folder without / Example: C:\Users\Alvaro\Documents\GitHub\forgottenserver
|
||||||
$config['server_path'] = '';
|
$config['server_path'] = '';
|
||||||
|
@ -116,11 +116,8 @@ function calculate_discount($orig, $new) {
|
|||||||
|
|
||||||
// Proper URLs
|
// Proper URLs
|
||||||
function url($path = false) {
|
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']);
|
$folder = dirname($_SERVER['SCRIPT_NAME']);
|
||||||
|
return config('site_url') . '/' . $path;
|
||||||
return $protocol . $domain . ($folder == '/' ? '' : $folder) . '/' . $path;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCache() {
|
function getCache() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user