sub eidiot {
#warn "eidiot depriciated";
idiot(@_);
- #exit;
- use Apache;
- Apache::exit;
+ if (exists $ENV{MOD_PERL}) {
+ eval {
+ use Apache;
+ Apache::exit();
+ };
+ } else {
+ exit;
+ }
}
=item popurl LEVEL
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);