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
Branches
Tags
No related merge requests found
......@@ -140,15 +140,17 @@ sub parse {
}
}
} elsif ($child->localname() eq 'ContactPerson') {
my %contact_details;
$contact_details{type} = $child->getAttribute('contactType');
if (defined $contact_details{type}) {
my $details;
$details->{type} = $child->getAttribute('contactType');
if (defined $details->{type}) {
foreach my $contact_child ($child->childNodes()) {
next unless $contact_child->nodeType() == XML_ELEMENT_NODE;
$contact_details{ $contact_child->localname() } =
$contact_child->textContent();
my $key = $contact_child->localname();
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') {
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