From 28d0e1291b3119b0bef1e1e887676f2c29e35c25 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 21 Jan 2007 09:10:46 +0000 Subject: [PATCH] fix svc_url to work no matter where we are coming from in the tree - use rooturl() instead of popurl() --- FS/FS/CGI.pm | 7 +++++-- FS/FS/UI/Web.pm | 5 ++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/FS/FS/CGI.pm b/FS/FS/CGI.pm index 88548cdec..a85d48ab6 100644 --- a/FS/FS/CGI.pm +++ b/FS/FS/CGI.pm @@ -239,14 +239,17 @@ sub rooturl { #even though this is kludgy $url_string =~ s{ - (browse|config|docs|edit|graph|misc|search|view|pref) + / + (browse|config|docs|edit|graph|misc|search|view|pref|rt) / (process/)? - ([\w\-\.]+) + ([\w\-\.\/]+) $ } {}x; + $url_string .= '/' unless $url_string =~ /\/$/; + $url_string; } diff --git a/FS/FS/UI/Web.pm b/FS/FS/UI/Web.pm index 15ec1a730..d7730c1fa 100644 --- a/FS/FS/UI/Web.pm +++ b/FS/FS/UI/Web.pm @@ -91,7 +91,7 @@ passed as a list of name-value pairs, and include: # ## # 'ahref' => 1, # if set true, returns -use FS::CGI qw(popurl); +use FS::CGI qw(rooturl); sub svc_url { my %opt = @_; @@ -112,8 +112,7 @@ sub svc_url { $url .= 'svcnum=' if $query =~ /^\d+(;|$)/ or $query eq ''; } - my $p = popurl(2); #? - my $return = "$p$opt{action}/$url$query"; + my $return = rooturl(). "$opt{action}/$url$query"; $return = qq!! if $opt{ahref}; -- 2.11.0