Changeset

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
parents 827:e801edea846a
children 829:9c134ff07d0f
files mod_lib_ldap/dev/t/02-vcard.t
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
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};