Skip to content
Snippets Groups Projects
Commit 88c6d28a authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

filter email adresses at parsing time

parent b15036aa
No related branches found
No related tags found
No related merge requests found
...@@ -140,15 +140,17 @@ sub parse { ...@@ -140,15 +140,17 @@ sub parse {
} }
} }
} elsif ($child->localname() eq 'ContactPerson') { } elsif ($child->localname() eq 'ContactPerson') {
my %contact_details; my $details;
$contact_details{type} = $child->getAttribute('contactType'); $details->{type} = $child->getAttribute('contactType');
if (defined $contact_details{type}) { if (defined $details->{type}) {
foreach my $contact_child ($child->childNodes()) { foreach my $contact_child ($child->childNodes()) {
next unless $contact_child->nodeType() == XML_ELEMENT_NODE; next unless $contact_child->nodeType() == XML_ELEMENT_NODE;
$contact_details{ $contact_child->localname() } = my $key = $contact_child->localname();
$contact_child->textContent(); my $value = $contact_child->textContent();
$value =~ s/^mailto:// if $key eq 'EmailAddress';
$details->{$key} = $value;
} }
push @{ $data->{contacts} }, \%contact_details; push @{ $data->{contacts} }, $details;
} }
} elsif ($child->localname() eq 'Organization') { } elsif ($child->localname() eq 'Organization') {
foreach my $name ($child->getChildrenByLocalName('OrganizationName')) { foreach my $name ($child->getChildrenByLocalName('OrganizationName')) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment