From a3a129df5f85b4a8812ae69d37b7e88ae7e97444 Mon Sep 17 00:00:00 2001 From: Shish Date: Fri, 27 Mar 2020 20:53:21 +0000 Subject: [PATCH] more niceurlness --- ext/et/main.php | 4 ++-- ext/setup/main.php | 15 +++------------ ext/statsd/main.php | 3 --- index.php | 2 +- 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/ext/et/main.php b/ext/et/main.php index c7e3a3ad..09edb26c 100644 --- a/ext/et/main.php +++ b/ext/et/main.php @@ -63,7 +63,7 @@ class ET extends Extension "about" => [ 'title' => $config->get_string(SetupConfig::TITLE), 'theme' => $config->get_string(SetupConfig::THEME), - 'url' => "http://" . $_SERVER["HTTP_HOST"] . get_base_href(), + 'url' => make_http(make_link("/")), ], "versions" => [ 'shimmie' => VERSION, @@ -71,7 +71,7 @@ class ET extends Extension 'php' => phpversion(), 'db' => $database->get_driver_name() . " " . $database->get_version(), 'os' => php_uname(), - 'server' => isset($_SERVER["SERVER_SOFTWARE"]) ? $_SERVER["SERVER_SOFTWARE"] : 'unknown', + 'server' => $_SERVER["SERVER_SOFTWARE"] ?? 'unknown', ], "extensions" => [ "core" => $core_exts, diff --git a/ext/setup/main.php b/ext/setup/main.php index 88e32009..17aa666a 100644 --- a/ext/setup/main.php +++ b/ext/setup/main.php @@ -324,16 +324,7 @@ class Setup extends Extension $themes[$human] = $name; } - if (isset($_SERVER["HTTP_HOST"])) { - $host = $_SERVER["HTTP_HOST"]; - } else { - $host = $_SERVER["SERVER_NAME"]; - if ($_SERVER["SERVER_PORT"] != "80") { - $host .= ":" . $_SERVER["SERVER_PORT"]; - } - } - $full = "//" . $host . $_SERVER["SCRIPT_NAME"]; - $test_url = str_replace("/index.php", "/nicetest", $full); + $test_url = make_http(str_replace("/index.php", "/nicetest", $_SERVER["SCRIPT_NAME"])); $nicescript = "