X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FCGI.pm;h=198477ce649d751eedf6f9fb4206b40364989a52;hb=4dba303c1989638060b9c76941f5e72fd35c4dd5;hp=3577c14b8f85be7221219a7bea644e5a8c067a27;hpb=6cd87c0d3b5280446301c647fa5f1ec5a593fa3f;p=freeside.git diff --git a/FS/FS/CGI.pm b/FS/FS/CGI.pm index 3577c14b8..198477ce6 100644 --- a/FS/FS/CGI.pm +++ b/FS/FS/CGI.pm @@ -123,7 +123,14 @@ Sends headers and an HTML error message, then exits. sub eidiot { #warn "eidiot depriciated"; idiot(@_); - exit; + if (exists $ENV{MOD_PERL}) { + eval { + use Apache; + Apache::exit(); + }; + } else { + exit; + } } =item popurl LEVEL @@ -134,8 +141,8 @@ Returns current URL with LEVEL levels of path removed from the end (default 0). sub popurl { my($up)=@_; - my($cgi)=&FS::UID::cgi; - my($url)=new URI::URL $cgi->url; + my $cgi = &FS::UID::cgi; + my $url = new URI::URL ( $cgi->isa('Apache') ? $cgi->uri : $cgi->url ); my(@path)=$url->path_components; splice @path, 0-$up; $url->path_components(@path);