Unverified Commit dfaec7e3 authored by IKEDA Soji's avatar IKEDA Soji Committed by GitHub
Browse files

Merge pull request #1187 from ikedas/issue-1185 by ikedas & dpc22

Fix noise in HTTP server error log (#1185)
parents aad96a08 88f80a01
......@@ -371,7 +371,7 @@ sub _sanitize_changes_set {
return () unless ref $new eq 'ARRAY'; # Sanity check
return () if $pitem->{obsolete};
return () unless $pitem->{privilege} eq 'write';
return () unless 'write' eq ($pitem->{privilege} // '');
# Resolve synonym.
if (ref $pitem->{synonym} eq 'HASH') {
......@@ -425,7 +425,7 @@ sub _sanitize_changes_array {
return () unless ref $new eq 'ARRAY'; # Sanity check
return () if $pitem->{obsolete};
return () unless $pitem->{privilege} eq 'write';
return () unless 'write' eq ($pitem->{privilege} // '');
my $i = -1;
my %ret = map {
......@@ -475,7 +475,7 @@ sub _sanitize_changes_paragraph {
return () unless ref $new eq 'HASH'; # Sanity check
return () if $pitem->{obsolete};
return () unless $pitem->{privilege} eq 'write';
return () unless 'write' eq ($pitem->{privilege} // '');
$self->_apply_defaults($cur, $pitem->{format},
init => ($options{init} and not $options{loading}));
......@@ -581,7 +581,7 @@ sub _sanitize_changes_leaf {
return () if ref $new eq 'ARRAY'; # Sanity check: Hashref or scalar
return () if $pitem->{obsolete};
return () unless $pitem->{privilege} eq 'write';
return () unless 'write' eq ($pitem->{privilege} // '');
# If the parameter corresponds to a scenario or a task, mark it
# as changed if its name was changed. Example: 'subscribe'.
......
......@@ -116,7 +116,7 @@ sub _twist {
if ($action =~ /\Areject\b/i) {
;
} elsif (
$sender ne $request->{email}
$sender ne ($request->{email} // '')
and
($request->{action} eq 'subscribe' or $request->{action} eq 'signoff')
) {
......
......@@ -80,8 +80,7 @@ sub lists {
my $self = shift; #$self is a service object
my $topic = shift;
my $subtopic = shift;
my $mode = shift;
$mode ||= '';
my $mode = shift // '';
my $sender = $ENV{'USER_EMAIL'};
my $robot = $ENV{'SYMPA_ROBOT'};
......@@ -1240,7 +1239,7 @@ sub complexLists {
## Simplified return structure
sub which {
my $self = shift;
my $mode = shift;
my $mode = shift // '';
my @result;
my $sender = $ENV{'USER_EMAIL'};
......@@ -1521,7 +1520,9 @@ sub setCustom {
## Return a structure in SOAP data format
## either flat (string) or structured (complexType)
sub struct_to_soap {
my ($data, $format) = @_;
my $data = shift;
my $format = shift // '';
my $soap_data;
unless (ref($data) eq 'HASH') {
......
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