aboutsummaryrefslogtreecommitdiff
path: root/lib/Apache/Inject.pm
diff options
context:
space:
mode:
authorroot <root@rbsd.ankarstrom.se>2021-04-23 20:09:02 +0000
committerroot <root@rbsd.ankarstrom.se>2021-04-23 20:09:02 +0000
commit52f6a565a10f454dae8e1c4d4985efe5f9661b7a (patch)
treeb285b56c113cf9da112aa0c6fdf65f0fed91dd00 /lib/Apache/Inject.pm
parent68373909df410fb1be8c664875e7fa4df2f7e2bc (diff)
downloadApache-Inject-52f6a565a10f454dae8e1c4d4985efe5f9661b7a.tar.gz
Support quoted arguments
Diffstat (limited to 'lib/Apache/Inject.pm')
-rw-r--r--lib/Apache/Inject.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Apache/Inject.pm b/lib/Apache/Inject.pm
index a9f1a61..7a504b6 100644
--- a/lib/Apache/Inject.pm
+++ b/lib/Apache/Inject.pm
@@ -19,12 +19,12 @@ Apache2::Module::add(__PACKAGE__, \@directives);
sub Inject {
my ($self, $parms, @args) = @_;
- # Validate arguments and construct corresponding directives
+ # Construct directives for passing arguments to handler
my @vars;
my @names = qw/InjectHead InjectFoot/;
for (@args) {
- die 'Arguments to Inject directive cannot contain quotes' if /"/;
- push @vars, 'PerlSetVar ' . (shift @names) . ' ' . $_;
+ s/\\/\\\\/; s/"/\\"/;
+ push @vars, 'PerlSetVar ' . (shift @names) . ' "' . $_ . '"';
}
# Add relevant directives to current configuration