aboutsummaryrefslogtreecommitdiff
path: root/lib/Apache/Inject
diff options
context:
space:
mode:
authorroot <root@rbsd.ankarstrom.se>2021-04-26 12:26:06 +0000
committerroot <root@rbsd.ankarstrom.se>2021-04-26 12:26:06 +0000
commite1c7d5442ca1d3bd67c200d2dbd94bd0e40e72bd (patch)
treefe2b3bb1c7e3612f05311d591f3704deb912fcd4 /lib/Apache/Inject
parente455862603e1ae1842b26bc9cbe685e5c4ee2d90 (diff)
downloadApache-Inject-e1c7d5442ca1d3bd67c200d2dbd94bd0e40e72bd.tar.gz
Use single hyphen for NULL value, allow the user to specify it
This lets the user inject a footer without injecting a header.
Diffstat (limited to 'lib/Apache/Inject')
-rw-r--r--lib/Apache/Inject/Handler.pm14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Apache/Inject/Handler.pm b/lib/Apache/Inject/Handler.pm
index f9254fd..0e054e7 100644
--- a/lib/Apache/Inject/Handler.pm
+++ b/lib/Apache/Inject/Handler.pm
@@ -12,14 +12,14 @@ use Apache2::RequestUtil ();
my $doc = qr{
\A
(?<head> \s*
- (<!doctype[^>]*>)? \s*
- (<html[^>]*>)? \s*
- ( <head[^>]*>.*?</head> \s*
+ ( <!doctype[^>]*> )? \s*
+ ( <html[^>]*> )? \s*
+ ( <head[^>]*> .*? </head> \s*
| ( <meta[^>]*> \s*
| <link[^>]*> \s*
- | <title[^>]*>.*?</title> \s*
- | <style[^>]*>.*?</style> \s* # n.b.
- | <script[^>]*>.*?</script> \s* # n.b.
+ | <title[^>]*> .*? </title> \s*
+ | <style[^>]*> .*? </style> \s*
+ | <script[^>]*> .*? </script> \s*
| <base[^>]*> \s*
)+
)?
@@ -57,7 +57,7 @@ sub inject {
# Retrieve value implicitly set by Inject directive
return if not (my $val = $r->dir_config($var));
- return if $val eq ' '; # special value signifying absence of argument
+ return if $val eq '-'; # special value signifying absence of argument
# Validate path
if ($val =~ m{^/}) {