#68: Use absolute path for default name_link

This commit is contained in:
ruan 2021-06-26 08:33:14 +02:00
parent b164f6e722
commit 15635939b9
3 changed files with 5 additions and 4 deletions

View File

@ -37,6 +37,10 @@ function navbar($links) {
function print_header() { function print_header() {
$page = $this->page; $page = $this->page;
$settings = $page->settings; $settings = $page->settings;
if ($page->settings->name_link === "index.php") {
$page->settings->name_link = $page->link("index.php");
}
if ($page->settings->header_show_totals) { if ($page->settings->header_show_totals) {
$t = $page->settings->table; $t = $page->settings->table;
$t_bans = $t['bans']; $t_bans = $t['bans'];

View File

@ -143,10 +143,6 @@ class Settings {
ini_set("display_errors", 1); ini_set("display_errors", 1);
} }
if ($this->simple_urls && $this->name_link === "index.php") {
$this->name_link = "../index/";
}
$this->active_query = ""; $this->active_query = "";
if ($this->driver === "pgsql") { if ($this->driver === "pgsql") {

View File

@ -5,6 +5,7 @@ $page = new Page("index",false);
if ($page->settings->simple_urls && count($_GET) !== 0) { if ($page->settings->simple_urls && count($_GET) !== 0) {
$target = $page->get_requested_page(); $target = $page->get_requested_page();
if ($target !== "index" && strlen($target) <= 16 && preg_match("/^[a-z]+$/", $target)) { if ($target !== "index" && strlen($target) <= 16 && preg_match("/^[a-z]+$/", $target)) {
$local_script = "./${target}.php"; $local_script = "./${target}.php";
if (file_exists($local_script)) { if (file_exists($local_script)) {