Diff

mod_lib_ldap/dev/t/02-vcard.t @ 828:855b28e10b39

Fix vCard checking routine to handle avatars properly
author Rob Hoelz <rob@hoelz.ro>
date Tue, 18 Sep 2012 00:14:31 +0200
parent 827:e801edea846a
child 829:9c134ff07d0f
line wrap: on
line diff
--- a/mod_lib_ldap/dev/t/02-vcard.t	Tue Sep 18 00:14:00 2012 +0200
+++ b/mod_lib_ldap/dev/t/02-vcard.t	Tue Sep 18 00:14:31 2012 +0200
@@ -35,10 +35,14 @@
                 return;
             }
 
+            delete $vcard->{'_avatar_hash'}; # we don't check this
+            delete $vcard->{'PHOTO'};        # PHOTO data is treated specially
+                                             # by the vCard extension
+
             foreach my $key (keys %$vcard) {
                 my $value = $vcard->{$key};
 
-                $value = $value->[0];
+                $value = $value->[0] if ref($value) eq 'ARRAY';
 
                 if($value eq '') {
                     delete $vcard->{$key};