From f3c4a3392ef2f7df8d902b36612306b5b412873c Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Mon, 27 Sep 2021 10:09:44 -0700 Subject: [PATCH] Move special handling for link.cgi out to a theme function --- web-lib-funcs.pl | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/web-lib-funcs.pl b/web-lib-funcs.pl index b9ee1288b..0fd357927 100755 --- a/web-lib-funcs.pl +++ b/web-lib-funcs.pl @@ -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;