Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
smradius
smradius
Commits
8accbb9d
Commit
8accbb9d
authored
May 15, 2019
by
Nigel Kukard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Quote the variable we're interpolating into the regex
parent
01057715
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
lib/smradius/util.pm
lib/smradius/util.pm
+3
-2
No files found.
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
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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