From f19573221ae12c2fdccc1f39e040061aacbe4019 Mon Sep 17 00:00:00 2001 From: maxpozdeev Date: Thu, 3 Aug 2023 18:06:46 +0300 Subject: [PATCH] - more relative paths (cherry picked from commit cf39163d7b875eeec75777656e2b727f0b293e10) --- src/index.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/index.php b/src/index.php index c5d0ecd..a87bdaa 100644 --- a/src/index.php +++ b/src/index.php @@ -73,12 +73,17 @@ function redirectWithHashRoute(array $hash, array $q = []) function js_options() { + // Here we can use URIs instead of full URLs. + $homeUrl = htmlspecialchars(Config::getUrl('url')); + if ($homeUrl == '') { + $homeUrl = get_mttinfo('mtt_uri'); + } $a = array( "token" => htmlspecialchars(access_token()), "title" => get_unsafe_mttinfo('title'), "lang" => Lang::instance()->jsStrings(), - "mttUrl" => get_mttinfo('mtt_url'), - "homeUrl" => get_mttinfo('url'), + "mttUrl" => get_mttinfo('mtt_uri'), + "homeUrl" => $homeUrl, "apiUrl" => get_mttinfo('api_url'), "needAuth" => need_auth() ? true : false, "isLogged" => is_logged() ? true : false,