Commit 8accbb9d authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Quote the variable we're interpolating into the regex

parent 01057715
...@@ -86,8 +86,9 @@ sub templateReplace ...@@ -86,8 +86,9 @@ sub templateReplace
# Replace blanks # Replace blanks
while (my ($entireMacro,$section,$item,$default) = ($string =~ /(\%\{([a-z]+)\.([a-z0-9\-]+)(?:=([^\}]*))?\})/i )) { while (my ($entireMacro,$section,$item,$default) = ($string =~ /(\%\{([a-z]+)\.([a-z0-9\-]+)(?:=([^\}]*))?\})/i )) {
# Replace macro with ? # Replace macro with ? or the placeholder if specified
$string =~ s/$entireMacro/$placeholder/; # We also quote the entireMacro
$string =~ s/\Q$entireMacro\E/$placeholder/;
# Get value to substitute # Get value to substitute
my $value = (defined($hashref->{$section}) && defined($hashref->{$section}->{$item})) ? my $value = (defined($hashref->{$section}) && defined($hashref->{$section}->{$item})) ?
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment