mirror of
https://github.com/TheLocehiliosan/yadm
synced 2024-10-27 20:34:27 +00:00
Tighten up parsing of if-statement in default template
Require space after if and an ending %} after the condition.
This commit is contained in:
parent
a5b1067e02
commit
e2ed647c2a
4
yadm
4
yadm
@ -413,13 +413,13 @@ function replace_vars() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
function conditions() {
|
function conditions() {
|
||||||
pattern = ifs blank "*("
|
pattern = ifs blank "+("
|
||||||
for (label in c) {
|
for (label in c) {
|
||||||
value = c[label]
|
value = c[label]
|
||||||
gsub(/[\\.^$(){}\[\]|*+?]/, "\\\\&", value)
|
gsub(/[\\.^$(){}\[\]|*+?]/, "\\\\&", value)
|
||||||
pattern = sprintf("%syadm\\.%s" blank "*==" blank "*\"%s\"|", pattern, label, value)
|
pattern = sprintf("%syadm\\.%s" blank "*==" blank "*\"%s\"|", pattern, label, value)
|
||||||
}
|
}
|
||||||
sub(/\|$/,")",pattern)
|
sub(/\|$/, ")" blank "*%}$", pattern)
|
||||||
return pattern
|
return pattern
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
Loading…
Reference in New Issue
Block a user