Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
smradius
smradius
Commits
8accbb9d
Commit
8accbb9d
authored
May 15, 2019
by
Nigel Kukard
Browse files
Quote the variable we're interpolating into the regex
parent
01057715
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/smradius/util.pm
View file @
8accbb9d
...
...
@@ -86,8 +86,9 @@ sub templateReplace
# Replace blanks
while
(
my
(
$entireMacro
,
$section
,
$item
,
$default
)
=
(
$string
=~
/(\%\{([a-z]+)\.([a-z0-9\-]+)(?:=([^\}]*))?\})/i
))
{
# Replace macro with ?
$string
=~
s/$entireMacro/$placeholder/
;
# Replace macro with ? or the placeholder if specified
# We also quote the entireMacro
$string
=~
s/\Q$entireMacro\E/$placeholder/
;
# Get value to substitute
my
$value
=
(
defined
(
$hashref
->
{
$section
})
&&
defined
(
$hashref
->
{
$section
}
->
{
$item
}))
?
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment