From c14a36079cf598438a1b7647e068d9e789a123e1 Mon Sep 17 00:00:00 2001 From: Shish Date: Mon, 11 Jul 2016 13:00:54 +0100 Subject: [PATCH] add option to force a specific base url --- core/sys_config.inc.php | 3 ++- core/util.inc.php | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/sys_config.inc.php b/core/sys_config.inc.php index 506c8993..50ac40a6 100644 --- a/core/sys_config.inc.php +++ b/core/sys_config.inc.php @@ -39,7 +39,8 @@ _d("WH_SPLITS", 1); // int how many levels of subfolders to put in _d("VERSION", '2.5.5+'); // string shimmie version _d("TIMEZONE", null); // string timezone _d("CORE_EXTS", "bbcode,user,mail,upload,image,view,handle_pixel,ext_manager,setup,upgrade,handle_404,comment,tag_list,index,tag_edit,alias_editor"); // extensions to always enable -_d("EXTRA_EXTS", ""); // optional extra extensions +_d("EXTRA_EXTS", ""); // string optional extra extensions +_d("BASE_URL", null); // string force a specific base URL (default is auto-detect) /* diff --git a/core/util.inc.php b/core/util.inc.php index c3d5a6c5..274219e8 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -444,7 +444,10 @@ function make_link($page=null, $query=null) { if(is_null($page)) $page = $config->get_string('main_page'); - if(NICE_URLS || $config->get_bool('nice_urls', false)) { + if(!is_null(BASE_URL)) { + $base = BASE_URL; + } + elseif(NICE_URLS || $config->get_bool('nice_urls', false)) { $base = str_replace('/'.basename($_SERVER["SCRIPT_FILENAME"]), "", $_SERVER["PHP_SELF"]); } else {