Commit 9caab590 authored by Xavier Guimard's avatar Xavier Guimard

Avoid some warnings

parent 60707051
......@@ -24,9 +24,13 @@ sub build_jail {
my ( $self, $api ) = @_;
return $self->jail
if ( $self->jail
&& $self->jail->useSafeJail == $self->useSafeJail
&& $self->jail->customFunctions == $self->customFunctions );
if ( $self->jail
and $self->jail->useSafeJail
and $self->jail->customFunctions
and $self->useSafeJail
and $self->customFunctions
and $self->jail->useSafeJail == $self->useSafeJail
and $self->jail->customFunctions == $self->customFunctions );
$self->useSafeJail(1) unless defined $self->useSafeJail;
......
......@@ -205,9 +205,13 @@ sub defaultValuesInit {
my $name = 'vhost' . ucfirst($opt);
foreach my $vhost ( keys %{ $conf->{vhostOptions} } ) {
my $val = $conf->{vhostOptions}->{$vhost}->{$name};
$class->lmLog( "Options $opt for vhost $vhost: $val", 'debug' );
$class->tsv->{$opt}->{$vhost} = $val
if ( $val >= 0 ); # Keep default value if $val is negative
# Keep default value if $val is negative
if ( defined $val and $val >= 0 ) {
$class->lmLog( "Options $opt for vhost $vhost: $val",
'debug' );
$class->tsv->{$opt}->{$vhost} = $val;
}
}
}
}
......@@ -332,7 +336,7 @@ sub headersInit {
foreach my $vhost ( keys %{ $conf->{exportedHeaders} } ) {
my %headers = %{ $conf->{exportedHeaders}->{$vhost} };
$class->tsv->{headerList}->{$vhost} = [ keys %headers ];
my $sub;
my $sub = '';
foreach ( keys %headers ) {
my $val = $class->substitute( $headers{$_} );
$sub .= "('$_' => $val),";
......
......@@ -66,12 +66,12 @@ count(7);
# TODO: check result of this
ok( $res = &client->jsonResponse('/diff/1/2'), 'Diff called' );
my ( @c1, @c2 );
ok( @c1 = sort ( keys %{ $res->[0] } ), 'diff() detects changes in conf 1' );
ok( @c2 = sort ( keys %{ $res->[1] } ), 'diff() detects changes in conf 2' );
ok( ( @c1 = sort keys %{ $res->[0] } ), 'diff() detects changes in conf 1' );
ok( ( @c2 = sort keys %{ $res->[1] } ), 'diff() detects changes in conf 2' );
ok( @c1 == 12, '12 keys changed in conf 1' )
or print STDERR "Expect: 11, get: " . @c1 . "\n";
or print STDERR "Expect: 11 keys, get: " . join( ', ', @c1 ) . "\n";
ok( @c2 == 13, '13 keys changed or created in conf 2' )
or print STDERR "Expect: 14, get: " . @c2 . "\n";
or print STDERR "Expect: 14 keys, get: " . join( ',', @c2 ) . "\n";
count(5);
......
Markdown is supported
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