Commit 067e92a1 authored by root's avatar root
Browse files

Every time users were loaded via include8sql_query Sympa would raise warnings...

Every time users were loaded via include8sql_query Sympa would raise warnings : Use of uninitialized value  in printf at /usr/local/sympa/bin/Sympa/DataSource/SQL.pm line 91. Obviously the issue was introduced back in 2015, as mentionned in https://listes.renater.fr/sympa/arc/sympa-users/2015-12/msg00002.html.
parent f88d6750
......@@ -86,9 +86,14 @@ sub _open {
my ($email, $value) = @$row;
next unless defined $email and length $email;
$email =~ s/[\t\r\n]+/ /g;
$value =~ s/[\t\r\n]+/ /g if defined $value;
printf $tmpfh "%s\t%s\n", $email, $value;
# The SQL query may return the user name
if ($value) {
$value =~ s/[\t\r\n]+/ /g if defined $value;
printf $tmpfh "%s\t%s\n", $email, $value;
}else {
printf $tmpfh "%s\n", $email;
}
}
}
$sth->finish;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment