aboutsummaryrefslogtreecommitdiff
path: root/lib/Apache/Inject
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Apache/Inject')
-rw-r--r--lib/Apache/Inject/Handler.pm11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/Apache/Inject/Handler.pm b/lib/Apache/Inject/Handler.pm
index 5a40fd8..708b68b 100644
--- a/lib/Apache/Inject/Handler.pm
+++ b/lib/Apache/Inject/Handler.pm
@@ -36,11 +36,11 @@ sub inject {
# Validate path
if ($val =~ m{^/}) {
- warn "$var should not begin with slash, "
- . "as it is already always relative to document root";
+ $r->log_error("Inject: $var should not begin with slash, "
+ . "as it is already always relative to document root");
}
if ($val =~ m{^../|/../|/..$}) {
- warn "$var cannot extend past document root";
+ $r->log_error("Inject: $var cannot extend past document root");
return;
}
@@ -49,7 +49,7 @@ sub inject {
# Read contents of specified file
open my $fh, '<', "$root/$val" or do {
- warn "$var $root/$val does not exist";
+ $r->log_error("Inject: $var $root/$val does not exist");
return;
};
print for <$fh>;
@@ -64,9 +64,8 @@ sub handler {
my $content = ${$r->slurp_filename};
return DECLINED if not $content =~ /$doc/;
- # Or is DocumentRoot guaranteed not to be empty?
if (not $r->document_root) {
- warn 'Declining request due to empty document root';
+ $r->warn('Inject: Declining request due to empty document root');
return DECLINED;
}