projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use Apache inside an eval BLOCK was mucking things up for the non-mod_perl folks
[freeside.git]
/
FS
/
FS
/
CGI.pm
diff --git
a/FS/FS/CGI.pm
b/FS/FS/CGI.pm
index
47c034e
..
6078ad9
100644
(file)
--- a/
FS/FS/CGI.pm
+++ b/
FS/FS/CGI.pm
@@
-121,11
+121,14
@@
Sends headers and an HTML error message, then exits.
=cut
sub eidiot {
=cut
sub eidiot {
-
#
warn "eidiot depriciated";
+ warn "eidiot depriciated";
idiot(@_);
idiot(@_);
- #exit;
- use Apache;
- Apache::exit;
+ if (exists $ENV{MOD_PERL}) {
+ require Apache;
+ Apache::exit();
+ } else {
+ exit;
+ }
}
=item popurl LEVEL
}
=item popurl LEVEL
@@
-136,8
+139,8
@@
Returns current URL with LEVEL levels of path removed from the end (default 0).
sub popurl {
my($up)=@_;
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);
my(@path)=$url->path_components;
splice @path, 0-$up;
$url->path_components(@path);