Test if service parameter is an array (#2673)

This commit is contained in:
Clément OUDOT 2022-01-24 18:51:19 +01:00
parent 72c0923ff0
commit 2d3cb1ca4c

View File

@ -309,6 +309,16 @@ sub _isNewCasAppServiceUrlUnique {
my ( $self, $conf, $confKey, $casApp ) = @_;
my $curServiceUrl =
$self->_getCasAppByConfKey( $conf, $confKey )->{options}->{service};
# Check service paramater
unless ( ref $casApp->{options}->{service} eq "ARRAY" ) {
return {
res => 'ko',
code => 400,
msg => "The parameter 'service' must be an array",
};
}
my $newService = $casApp->{options}->{service} || [];
for my $newServiceUrl (@$newService) {
if ( $newServiceUrl ne ''