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
ceb2e82a
Commit
ceb2e82a
authored
May 16, 2019
by
Nigel Kukard
Browse files
Remove spaces from the end of attribute values when using conditionals
parent
9ff2149e
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/smradius/attributes.pm
View file @
ceb2e82a
...
...
@@ -794,7 +794,8 @@ sub processConditional
# Split off expression
my
(
$condition
,
$onTrue
,
$onFalse
)
=
(
$attrVal
=~
/^([^\?]*)(?:\?\s*((?:\S+)?[^:]*)(?:\s*\:\s*(.*))?)?$/
);
# NK: This probably needs a bit of work
my
(
$condition
,
$onTrue
,
$onFalse
)
=
(
$attrVal
=~
/^([^\?]*)(?:\?\s*((?:\S+)?[^:]*)(?:\:\s*(.*))?)?$/
);
# If there is no condition we cannot really continue?
if
(
!
defined
(
$condition
))
{
...
...
@@ -842,6 +843,10 @@ sub processConditional
$res
=
1
;
}
# Sanitize the output
$attribStr
=~
s/^\s*//
;
$attribStr
=~
s/\s*$//
;
$server
->
log
(
LOG_DEBUG
,"
[ATTRIBUTES] - Evaluated to '
$res
' returning '
"
.
(
defined
(
$attribStr
)
?
$attribStr
:
"
-undef-
")
.
"
'
");
# Loop with attributes:
...
...
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