From 52f6a565a10f454dae8e1c4d4985efe5f9661b7a Mon Sep 17 00:00:00 2001 From: root Date: Fri, 23 Apr 2021 20:09:02 +0000 Subject: Support quoted arguments --- lib/Apache/Inject.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') 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 -- cgit v1.2.3