Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Sympa
Commits
27199170
Unverified
Commit
27199170
authored
Dec 26, 2019
by
IKEDA Soji
Committed by
GitHub
Dec 26, 2019
Browse files
Merge pull request #833 from ikedas/issue-831 by ikedas
Scenario fails with negative indices in [header->Field][n] (#831)
parents
07d185db
cc700b91
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/Sympa/Scenario.pm
View file @
27199170
...
...
@@ -8,8 +8,8 @@
# Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
# 2006, 2007, 2008, 2009, 2010, 2011 Comite Reseau des Universites
# Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017 GIP RENATER
# Copyright 2017, 2018 The Sympa Community. See the AUTHORS.md file
at the
# top-level directory of this distribution and at
# Copyright 2017, 2018
, 2019
The Sympa Community. See the AUTHORS.md file
#
at the
top-level directory of this distribution and at
# <https://github.com/sympa-community/sympa.git>.
#
# This program is free software; you can redistribute it and/or modify
...
...
@@ -583,9 +583,11 @@ sub _compile_scenario {
my
$required
=
join
"
\n
",
map
{
my
$req
;
if
(
$_
eq
'
list_object
')
{
$req
=
'
return undef unless ref $that eq
\'
Sympa::List
\'
;
';
$req
=
'
die "No list context" unless ref $that eq
\'
Sympa::List
\'
;
';
}
elsif
(
$_
eq
'
message
')
{
$req
=
sprintf
'
$context->{message} ||= Sympa::Message->new("\n");
';
}
else
{
$req
=
sprintf
'
return undef
unless exists $context->{%s};
',
$_
;
$req
=
sprintf
'
die "Missing parameter
\'
%s
\'
"
unless exists $context->{%s};
',
$_
,
$_
;
}
"
$req
";
}
sort
keys
%required
;
...
...
@@ -785,7 +787,7 @@ sub _compile_condition {
## available.
if
(
defined
$index
)
{
$value
=
sprintf
'
[
$context->{message}->get_header(
\'
%s
\'
)
]->
[%s]
',
sprintf
'
do { my @h =
$context->{message}->get_header(
\'
%s
\'
)
; $h
[%s]
}
',
$field_name
,
$index
;
}
else
{
$value
=
sprintf
'
[$context->{message}->get_header(
\'
%s
\'
)]
',
...
...
Write
Preview
Supports
Markdown
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