Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sympa
sympa
Commits
a601f11a
Commit
a601f11a
authored
Nov 07, 2019
by
IKEDA Soji
Browse files
Check availability of regexps.
parent
da8f0775
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/Sympa/Scenario.pm
View file @
a601f11a
...
...
@@ -673,10 +673,19 @@ sub _compile_condition {
if
(
$value
=~
m{\A/(.+)/\z}
)
{
my
$re
=
$
1
;
$re
=~
s{(\\.|.)}{($1 eq "'" or $1 eq "\\")? "\\\'" : $1}eg
;
# Fix orphan "'" and "\".
$re
=~
s{(\\.|.)}{($1 eq "'" or $1 eq "\\")? "\\$1" : $1}eg
;
# regexp w/o interpolates
$value
=
sprintf
'
Sympa::Scenario::safe_qr(
\'
%s
\'
, $context)
',
$re
;
unless
(
defined
eval
"
qr'
$re
'
")
{
$log
->
syslog
('
err
',
'
Bad regexp /%s/: %s
',
$re
,
$EVAL_ERROR
);
return
undef
;
}
if
(
$re
=~
/[[](domain|host)[]]/
)
{
$value
=
sprintf
'
Sympa::Scenario::safe_qr(
\'
%s
\'
, $context)
',
$re
;
}
else
{
$value
=
"
qr'
$re
'
";
}
}
elsif
(
$value
=~
/\[custom_vars\-\>([\w\-]+)\]/i
)
{
# Custom vars
$value
=
sprintf
'
$context->{custom_vars}{%1}
',
$
1
;
...
...
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