Commit a46bac12 authored by sikeda's avatar sikeda
Browse files

[-bug] Suppress warnings on uninitialized value.


git-svn-id: https://subversion.renater.fr/sympa/branches/sympa-6.2-branch@12111 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent 3e4a0399
......@@ -194,10 +194,10 @@ sub authentication {
# increment wrong login count.
Sympa::User::update_global_user($email,
{wrong_login_count => $user->{'wrong_login_count'} + 1});
{wrong_login_count => ($user->{'wrong_login_count'} || 0) + 1});
Sympa::Report::reject_report_web('user', 'incorrect_passwd', {})
unless ($ENV{'SYMPA_SOAP'});
unless $ENV{'SYMPA_SOAP'};
$log->syslog('err', 'Incorrect password for user %s', $email);
my $param; #FIXME FIXME: not used.
......
......@@ -4803,13 +4803,13 @@ sub update_list_member {
if ($map_table{$field} eq $table) {
if ($field eq 'date' || $field eq 'update_date') {
$value = SDM::get_canonical_write_date($value);
} elsif ($value eq 'NULL') { ## get_null_value?
} elsif ($value and $value eq 'NULL') { # get_null_value?
if ($Conf::Conf{'db_type'} eq 'mysql') {
$value = '\N';
}
} else {
if ($numeric_field{$map_field{$field}}) {
$value ||= 0; ## Can't have a null value
$value ||= 0; ## Can't have a null value
} else {
$value = SDM::quote($value);
}
......@@ -4965,13 +4965,13 @@ sub update_list_admin {
if ($map_table{$field} eq $table) {
if ($field eq 'date' || $field eq 'update_date') {
$value = SDM::get_canonical_write_date($value);
} elsif ($value eq 'NULL') { #get_null_value?
} elsif ($value and $value eq 'NULL') { # get_null_value?
if ($Conf::Conf{'db_type'} eq 'mysql') {
$value = '\N';
}
} else {
if ($numeric_field{$map_field{$field}}) {
$value ||= 0; ## Can't have a null value
$value ||= 0; ## Can't have a null value
} else {
$value = SDM::quote($value);
}
......@@ -5472,7 +5472,10 @@ sub am_i {
}
} elsif ($function =~ /^privileged_owner$/i) {
my $privileged = $self->get_list_admin('owner', $who);
if ($privileged->{'profile'} eq 'privileged') {
if (Sympa::Tools::Data::smart_eq(
$privileged->{'profile'}, 'privileged'
)
) {
## Update cache
$list_cache{'am_i'}{'privileged_owner'}{$self->{'domain'}}
......
......@@ -38,12 +38,11 @@ my $log = Sympa::Log->instance;
sub tmp_passwd {
my $email = shift;
my $cookie = $Conf::Conf{'cookie'};
$cookie = '' unless defined $cookie;
return (
'init'
. substr(
Digest::MD5::md5_hex(join('/', $Conf::Conf{'cookie'}, $email)), -8
)
);
'init' . substr(Digest::MD5::md5_hex(join '/', $cookie, $email), -8));
}
# global var to store a CipherSaber object
......
......@@ -229,11 +229,10 @@ sub init_passwd {
}
sub get_my_url {
my $return_url;
## Mod_ssl sets SSL_PROTOCOL ; apache-ssl sets SSL_PROTOCOL_VERSION
if ($ENV{'HTTPS'} eq 'on') {
# mod_ssl sets SSL_PROTOCOL; Apache-SSL sets SSL_PROTOCOL_VERSION.
if ($ENV{'HTTPS'} and $ENV{'HTTPS'} eq 'on') {
$return_url = 'https';
} else {
$return_url = 'http';
......@@ -241,8 +240,8 @@ sub get_my_url {
$return_url .= '://' . &main::get_header_field('HTTP_HOST');
$return_url .= ':' . $ENV{'SERVER_PORT'}
unless (($ENV{'SERVER_PORT'} eq '80')
|| ($ENV{'SERVER_PORT'} eq '443'));
unless $ENV{'SERVER_PORT'} eq '80'
or $ENV{'SERVER_PORT'} eq '443';
$return_url .= $ENV{'REQUEST_URI'};
return ($return_url);
}
......
......@@ -2066,7 +2066,7 @@ sub _update_subscriber_bounce_history {
return undef;
}
if ($user->{'bounce'} =~ /^(\d+)\s\d+\s+(\d+)/) {
if ($user->{'bounce'} and $user->{'bounce'} =~ /^(\d+)\s\d+\s+(\d+)/) {
($first, $count) = ($1, $2);
}
$count++;
......
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