From 5f408629bdbb64a60614e58de7dec4f3488e27cd Mon Sep 17 00:00:00 2001 From: ramonn Date: Wed, 2 Sep 2009 14:54:04 +0000 Subject: [PATCH] 2009-09-02 Ramon Novoa * lib/PandoraFMS/Core.pm: HTML entities in alert fields are properly decoded. Alert emails can be sent to multiple comma separated addresses. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1907 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 6 ++++++ pandora_server/lib/PandoraFMS/Core.pm | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 0c451a74ba..dc4030e565 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,9 @@ +2009-09-02 Ramon Novoa + + * lib/PandoraFMS/Core.pm: HTML entities in alert fields are properly + decoded. Alert emails can be sent to multiple comma separated + addresses. + 2009-09-02 Sancho Lerena * lib/PandoraFMS/PluginServer.pm, util/pandora_exec: Nagis plugin diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 0461b2c9d5..64560afd7d 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -459,9 +459,13 @@ sub pandora_execute_action ($$$$$$$) { # Email } elsif ($action->{'name'} eq "eMail") { - $field2 = subst_alert_macros ($field2, \%macros); - $field3 = subst_alert_macros ($field3, \%macros); - pandora_sendmail ($pa_config, $field1, $field2, $field3); + $field2 = decode_entities (subst_alert_macros ($field2, \%macros)); + $field3 = decode_entities (subst_alert_macros ($field3, \%macros)); + foreach my $address (split (',', $field1)) { + # Remove blanks + $address =~ s/ +//g; + pandora_sendmail ($pa_config, $address, $field2, $field3); + } # Internal event } elsif ($action->{'name'} eq "Pandora FMS Event") {