Move special handling for link.cgi out to a theme function

This commit is contained in:
Jamie Cameron
2021-09-27 10:09:44 -07:00
parent 50087e9dbe
commit f3c4a3392e

View File

@@ -11652,18 +11652,11 @@ Returns ready to use webprefix
=cut
sub get_webprefix
{
my $webprefix = $gconfig{'webprefix'};
my $parent_proxy_detected = 0;
my $parent_proxy = $ENV{'HTTP_COMPLETE_WEBMIN_PATH'} || $ENV{'HTTP_WEBMIN_PATH'};
if ($parent_proxy) {
my ($parent_proxy_link) = $parent_proxy =~ /(\S*?\/link\.cgi\/[\d]{8,16})/;
my ($parent_proxy_prefix) = $parent_proxy_link =~ /:\d+(\S*?\/link\.cgi\/\S*?\d+)/;
if ($parent_proxy_prefix) {
$webprefix = $parent_proxy_prefix;
$parent_proxy_detected = 1;
}
}
return wantarray ? ($webprefix, $parent_proxy_detected) : $webprefix;
&load_theme_library();
if (defined(&theme_get_webprefix)) {
return &theme_get_webprefix();
}
return $gconfig{'webprefix'};
}
$done_web_lib_funcs = 1;