Fix variable names to avoid ambiguity

* Note: Discussed here:
https://github.com/webmin/webmin/pull/2553#issuecomment-3328436525
This commit is contained in:
Ilia Ross
2025-09-25 15:23:06 +03:00
parent f08ad4eb19
commit a027ad5dd6
5 changed files with 14 additions and 14 deletions

View File

@@ -16,9 +16,9 @@ my $timeout = $gconfig{'passreset_timeout'} || 15;
$remote_user && &error($text{'forgot_elogin'});
$ENV{'HTTPS'} eq 'ON' || $gconfig{'forgot_pass'} == 2 ||
&error($text{'forgot_essl'});
$ENV{'SSL_HOST_CERT'} == 1 ||
$ENV{'SSL_CN_CERT'} == 1 ||
&error(&text('forgot_esslhost',
&html_escape($ENV{'HTTP_HOST'} || $ENV{'SSL_HOST'})))
&html_escape($ENV{'HTTP_HOST'} || $ENV{'SSL_CN'})))
if ($ENV{'HTTPS'} eq 'ON');
# Check that the random ID is valid

View File

@@ -15,9 +15,9 @@ $gconfig{'forgot_pass'} || &error($text{'forgot_ecannot'});
$remote_user && &error($text{'forgot_elogin'});
$ENV{'HTTPS'} eq 'ON' || $gconfig{'forgot_pass'} == 2 ||
&error($text{'forgot_essl'});
$ENV{'SSL_HOST_CERT'} == 1 ||
$ENV{'SSL_CN_CERT'} == 1 ||
&error(&text('forgot_esslhost',
&html_escape($ENV{'HTTP_HOST'} || $ENV{'SSL_HOST'})))
&html_escape($ENV{'HTTP_HOST'} || $ENV{'SSL_CN'})))
if ($ENV{'HTTPS'} eq 'ON');
&ui_print_header(undef, $text{'forgot_title'}, "", undef, undef, 1, 1);

View File

@@ -14,9 +14,9 @@ $gconfig{'forgot_pass'} || &error($text{'forgot_ecannot'});
$remote_user && &error($text{'forgot_elogin'});
$ENV{'HTTPS'} eq 'ON' || $gconfig{'forgot_pass'} == 2 ||
&error($text{'forgot_essl'});
$ENV{'SSL_HOST_CERT'} == 1 ||
$ENV{'SSL_CN_CERT'} == 1 ||
&error(&text('forgot_esslhost',
&html_escape($ENV{'HTTP_HOST'} || $ENV{'SSL_HOST'})))
&html_escape($ENV{'HTTP_HOST'} || $ENV{'SSL_CN'})))
if ($ENV{'HTTPS'} eq 'ON');
# Lookup the Webmin user

View File

@@ -942,8 +942,8 @@ while(1) {
($ssl_con,
$ssl_certfile,
$ssl_keyfile,
$ssl_host,
$ssl_cert_hosts) =
$ssl_cn,
$ssl_alts) =
&ssl_connection_for_ip(
SOCK, $ipv6fhs{$s});
print DEBUG "ssl_con returned ".
@@ -2503,9 +2503,9 @@ if (&get_type($full) eq "internal/cgi" && $validated != 4) {
$ENV{"HTTPS"} = $use_ssl ? "ON" : "";
$ENV{"SSL_HSTS"} = $config{"ssl_hsts"};
if ($use_ssl) {
$ENV{"SSL_HOST"} = $ssl_host;
$ENV{"SSL_HOST_CERT"} =
&ssl_hostname_match($header{'host'}, $ssl_cert_hosts);
$ENV{"SSL_CN"} = $ssl_cn;
$ENV{"SSL_CN_CERT"} =
&ssl_hostname_match($header{'host'}, $ssl_alts);
}
$ENV{"MINISERV_PID"} = $miniserv_main_pid;
if ($use_ssl) {

View File

@@ -13261,11 +13261,11 @@ if (!$def && $gconfig{'webmin_email_url'}) {
# From a config option
$url = $gconfig{'webmin_email_url'};
}
elsif ($ENV{'HTTP_HOST'} || $ENV{'SSL_HOST'}) {
elsif ($ENV{'HTTP_HOST'} || $ENV{'SSL_CN'}) {
# From this HTTP request
my $port = $ENV{'SERVER_PORT'} || 80;
my $host = $ENV{'SSL_HOST'}
? "$ENV{'SSL_HOST'}:$port"
my $host = $ENV{'SSL_CN'}
? "$ENV{'SSL_CN'}:$port"
: $ENV{'HTTP_HOST'};
if ($host =~ s/:(\d+)$//) {
$port = $1;