diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index b0ba73edfc..f0534a518d 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,6 +1,8 @@ - 2011-09-14 Sancho Lerena + * lib/PandoraFMS/DataServer.pm: Fixed a weird problem resolving GPS + coordinates with OpenStreet. + * lib/PandoraFMS/NmapParser.pm: Avoid warning messages. 2011-09-12 Sancho Lerena diff --git a/pandora_server/lib/PandoraFMS/DataServer.pm b/pandora_server/lib/PandoraFMS/DataServer.pm index 829e4b2508..c874bd88dc 100644 --- a/pandora_server/lib/PandoraFMS/DataServer.pm +++ b/pandora_server/lib/PandoraFMS/DataServer.pm @@ -235,11 +235,14 @@ sub process_xml_data ($$$$$) { # Change here URL to make request to a local openstreetmap server my $content = get ('http://nominatim.openstreetmap.org/reverse?format=csv&lat='.$latitude.'&lon='.$longitude.'&zoom=18&addressdetails=1&email=info@pandorafms.org'); - # Yep, I need to parse the XML output. - - my $xs1 = XML::Simple->new(); - my $doc = $xs1->XMLin($content); - $position_description = safe_input ($doc->{result}{content}); + if ((defined($content)) && ($content ne "")){ + # Yep, I need to parse the XML output. + my $xs1 = XML::Simple->new(); + my $doc = $xs1->XMLin($content); + $position_description = safe_input ($doc->{result}{content}); + } else { + $position_description = ""; + } } }