Consistently get the self URL.
This ensures all uses of the self URL get the same normalized/sanitized value.
This commit is contained in:
parent
94c49399cc
commit
a355221e7f
|
@ -98,11 +98,11 @@ class Digest
|
||||||
|
|
||||||
$tpl->setVariable('CUR_DATE', date('Y/m/d', $local_ts));
|
$tpl->setVariable('CUR_DATE', date('Y/m/d', $local_ts));
|
||||||
$tpl->setVariable('CUR_TIME', date('G:i', $local_ts));
|
$tpl->setVariable('CUR_TIME', date('G:i', $local_ts));
|
||||||
$tpl->setVariable('TTRSS_HOST', Config::get(Config::SELF_URL_PATH));
|
$tpl->setVariable('TTRSS_HOST', Config::get_self_url());
|
||||||
|
|
||||||
$tpl_t->setVariable('CUR_DATE', date('Y/m/d', $local_ts));
|
$tpl_t->setVariable('CUR_DATE', date('Y/m/d', $local_ts));
|
||||||
$tpl_t->setVariable('CUR_TIME', date('G:i', $local_ts));
|
$tpl_t->setVariable('CUR_TIME', date('G:i', $local_ts));
|
||||||
$tpl_t->setVariable('TTRSS_HOST', Config::get(Config::SELF_URL_PATH));
|
$tpl_t->setVariable('TTRSS_HOST', Config::get_self_url());
|
||||||
|
|
||||||
$affected_ids = array();
|
$affected_ids = array();
|
||||||
|
|
||||||
|
|
|
@ -418,7 +418,7 @@ class Handler_Public extends Handler {
|
||||||
|
|
||||||
$return = clean($_REQUEST['return']);
|
$return = clean($_REQUEST['return']);
|
||||||
|
|
||||||
if ($_REQUEST['return'] && mb_strpos($return, Config::get(Config::SELF_URL_PATH)) === 0) {
|
if ($_REQUEST['return'] && mb_strpos($return, Config::get_self_url()) === 0) {
|
||||||
header("Location: " . clean($_REQUEST['return']));
|
header("Location: " . clean($_REQUEST['return']));
|
||||||
} else {
|
} else {
|
||||||
header("Location: " . Config::get_self_url());
|
header("Location: " . Config::get_self_url());
|
||||||
|
@ -572,7 +572,7 @@ class Handler_Public extends Handler {
|
||||||
|
|
||||||
$tpl->setVariable('LOGIN', $login);
|
$tpl->setVariable('LOGIN', $login);
|
||||||
$tpl->setVariable('RESETPASS_LINK', $resetpass_link);
|
$tpl->setVariable('RESETPASS_LINK', $resetpass_link);
|
||||||
$tpl->setVariable('TTRSS_HOST', Config::get(Config::SELF_URL_PATH));
|
$tpl->setVariable('TTRSS_HOST', Config::get_self_url());
|
||||||
|
|
||||||
$tpl->addBlock('message');
|
$tpl->addBlock('message');
|
||||||
|
|
||||||
|
|
|
@ -251,7 +251,7 @@ class Pref_Prefs extends Handler_Protected {
|
||||||
|
|
||||||
$tpl->setVariable('LOGIN', $user->login);
|
$tpl->setVariable('LOGIN', $user->login);
|
||||||
$tpl->setVariable('NEWMAIL', $new_email);
|
$tpl->setVariable('NEWMAIL', $new_email);
|
||||||
$tpl->setVariable('TTRSS_HOST', Config::get(Config::SELF_URL_PATH));
|
$tpl->setVariable('TTRSS_HOST', Config::get_self_url());
|
||||||
|
|
||||||
$tpl->addBlock('message');
|
$tpl->addBlock('message');
|
||||||
|
|
||||||
|
@ -1002,7 +1002,7 @@ class Pref_Prefs extends Handler_Protected {
|
||||||
$tpl->readTemplateFromFile("otp_disabled_template.txt");
|
$tpl->readTemplateFromFile("otp_disabled_template.txt");
|
||||||
|
|
||||||
$tpl->setVariable('LOGIN', $row["login"]);
|
$tpl->setVariable('LOGIN', $row["login"]);
|
||||||
$tpl->setVariable('TTRSS_HOST', Config::get(Config::SELF_URL_PATH));
|
$tpl->setVariable('TTRSS_HOST', Config::get_self_url());
|
||||||
|
|
||||||
$tpl->addBlock('message');
|
$tpl->addBlock('message');
|
||||||
|
|
||||||
|
|
|
@ -451,7 +451,7 @@ class RPC extends Handler_Protected {
|
||||||
|
|
||||||
$params["safe_mode"] = !empty($_SESSION["safe_mode"]);
|
$params["safe_mode"] = !empty($_SESSION["safe_mode"]);
|
||||||
$params["check_for_updates"] = Config::get(Config::CHECK_FOR_UPDATES);
|
$params["check_for_updates"] = Config::get(Config::CHECK_FOR_UPDATES);
|
||||||
$params["icons_url"] = Config::get(Config::SELF_URL_PATH) . '/public.php';
|
$params["icons_url"] = Config::get_self_url() . '/public.php';
|
||||||
$params["cookie_lifetime"] = Config::get(Config::SESSION_COOKIE_LIFETIME);
|
$params["cookie_lifetime"] = Config::get(Config::SESSION_COOKIE_LIFETIME);
|
||||||
$params["default_view_mode"] = get_pref(Prefs::_DEFAULT_VIEW_MODE);
|
$params["default_view_mode"] = get_pref(Prefs::_DEFAULT_VIEW_MODE);
|
||||||
$params["default_view_limit"] = (int) get_pref(Prefs::_DEFAULT_VIEW_LIMIT);
|
$params["default_view_limit"] = (int) get_pref(Prefs::_DEFAULT_VIEW_LIMIT);
|
||||||
|
|
|
@ -54,7 +54,7 @@ class Sanitizer {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function is_prefix_https(): bool {
|
private static function is_prefix_https(): bool {
|
||||||
return parse_url(Config::get(Config::SELF_URL_PATH), PHP_URL_SCHEME) == 'https';
|
return parse_url(Config::get_self_url(), PHP_URL_SCHEME) == 'https';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -224,7 +224,7 @@ class Auth_Internal extends Auth_Base {
|
||||||
$tpl->readTemplateFromFile("password_change_template.txt");
|
$tpl->readTemplateFromFile("password_change_template.txt");
|
||||||
|
|
||||||
$tpl->setVariable('LOGIN', $user->login);
|
$tpl->setVariable('LOGIN', $user->login);
|
||||||
$tpl->setVariable('TTRSS_HOST', Config::get(Config::SELF_URL_PATH));
|
$tpl->setVariable('TTRSS_HOST', Config::get_self_url());
|
||||||
|
|
||||||
$tpl->addBlock('message');
|
$tpl->addBlock('message');
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue