Apache-FileManager
view release on metacpan or search on metacpan
FileManager.pm view on Meta::CPAN
#document root
my $dr = r->document_root;
$$o{DR} ||= r->dir_config('DOCUMENT_ROOT') || r->document_root;
#does user defined document root lie inside real doc root?
if ($$o{DR} !~ /^$dr/) {
$$o{DR} = r->document_root;
r->log_error("Warning: Document root changed to $dr. Custom document root must lie inside of real document root.");
}
#verify current working directory
$_ = r->param('FILEMANAGER_curr_dir');
s/\.\.//g; s/^\///; s/\/$//;
my $curr_dir = $_;
#set current directory
if (! chdir $$o{DR}."/$curr_dir") {
chdir $$o{DR};
$curr_dir = "";
}
r->param('FILEMANAGER_curr_dir' => $curr_dir);
( run in 0.560 second using v1.01-cache-2.11-cpan-5467b0d2c73 )