Skip to content

Commit 9ddb11e

Browse files
authored
Merge pull request #1889 from ikedas/confirm_distribute by ikedas
WWSynmpa: do_distribute: Confirmation was not always performed
2 parents 096fe95 + a8434aa commit 9ddb11e

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

Diff for: src/cgi/wwsympa.fcgi.in

+12-15
Original file line numberDiff line numberDiff line change
@@ -7550,27 +7550,24 @@ sub do_distribute {
75507550

75517551
my @ids = split /\0/, $in{'id'};
75527552
$param->{'id'} = [@ids];
7553-
my @topics = grep { defined $_ and length $_ } split /\0/, $in{'topic'};
7553+
my @topics =
7554+
grep { $list->is_available_msg_topic($_) } split /\0/, $in{'topic'};
75547555
$param->{'topic'} = [@topics];
75557556
$param->{'topic_required'} =
75567557
($list->is_there_msg_topic and $list->is_msg_topic_tagging_required);
75577558

75587559
# Action confirmed?
7559-
if ($param->{'topic_required'}) {
7560-
my $response_action = (
7561-
@topics # Topics are required.
7562-
or ($in{'response_action'}
7563-
and $in{'response_action'} eq 'cancel')
7564-
)
7565-
? $in{'response_action'}
7566-
: undef;
7567-
my $next_action = $session->confirm_action(
7568-
$in{'action'}, $response_action,
7569-
arg => join(',', sort @ids),
7570-
previous_action => ($in{'previous_action'} || 'modindex')
7571-
);
7572-
return $next_action unless $next_action eq '1';
7560+
unless ('cancel' eq ($in{'response_action'} // '')) {
7561+
# Redo confirmation if topics are required.
7562+
undef $in{'response_action'}
7563+
if not @topics and $param->{'topic_required'};
75737564
}
7565+
my $next_action = $session->confirm_action(
7566+
$in{'action'}, $in{'response_action'},
7567+
arg => join(',', sort @ids),
7568+
previous_action => ($in{'previous_action'} || 'modindex')
7569+
);
7570+
return $next_action unless $next_action eq '1';
75747571

75757572
# Load message list.
75767573
my @mail_command = ();

0 commit comments

Comments
 (0)