From 8a5b6ffc604f66e691657c4894bd96a0fc71aa90 Mon Sep 17 00:00:00 2001 From: janw Date: Mon, 6 Oct 2008 09:41:54 +0000 Subject: [PATCH] Fix for detecting empty tags that are required. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12603 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/gosa-si-server | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server index e0c98a709..61528f048 100755 --- a/gosa-si/gosa-si-server +++ b/gosa-si/gosa-si-server @@ -542,7 +542,7 @@ sub check_key_and_xml_validity { # check header if( not exists $msg_hash->{'header'} ) { die "no header specified"; } my $header_l = $msg_hash->{'header'}; - if( 1 > @{$header_l} ) { die 'empty header tag'; } + if( (1 > @{$header_l}) || ( ( 'HASH' eq ref @{$header_l}[0]) && (1 > keys %{@{$header_l}[0]}) ) ) { die 'empty header tag'; } if( 1 < @{$header_l} ) { die 'more than one header specified'; } my $header = @{$header_l}[0]; if( 0 == length $header) { die 'empty string in header tag'; } @@ -551,7 +551,7 @@ sub check_key_and_xml_validity { # check source if( not exists $msg_hash->{'source'} ) { die "no source specified"; } my $source_l = $msg_hash->{'source'}; - if( 1 > @{$source_l} ) { die 'empty source tag'; } + if( (1 > @{$source_l}) || ( ( 'HASH' eq ref @{$source_l}[0]) && (1 > keys %{@{$source_l}[0]}) ) ) { die 'empty source tag'; } if( 1 < @{$source_l} ) { die 'more than one source specified'; } my $source = @{$source_l}[0]; if( 0 == length $source) { die 'source error'; } @@ -560,7 +560,7 @@ sub check_key_and_xml_validity { # check target if( not exists $msg_hash->{'target'} ) { die "no target specified"; } my $target_l = $msg_hash->{'target'}; - if( 1 > @{$target_l} ) { die 'empty target tag'; } + if( (1 > @{$target_l}) || ( ('HASH' eq ref @{$target_l}[0]) && (1 > keys %{@{$target_l}[0]}) ) ) { die 'empty target tag'; } } }; if($@) { -- 2.30.2