From bdd55253e3f2da020eb0444c8e78769d076282ac Mon Sep 17 00:00:00 2001 From: darode Date: Wed, 9 Jan 2013 12:59:11 +0000 Subject: [PATCH] 2013-01-09 Dario Rodriguez * lib/PandoraFMS/DataServer.pm: Fixed a bug which creates modules with names which have \n\r and later create problems when editing the module information. MARGED FROM 4.0.3 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7394 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 8 ++++++++ pandora_server/lib/PandoraFMS/DataServer.pm | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 170930cb5e..ac1ad9af4a 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,11 @@ +2013-01-09 Dario Rodriguez + + * lib/PandoraFMS/DataServer.pm: Fixed a bug which creates modules + with names which have \n\r and later create problems when editing + the module information. + + MARGED FROM 4.0.3 + 2013-01-09 Sancho Lerena * lib/PandoraFMS/NetworkServer.pm: Fixed bug #3555223 about diff --git a/pandora_server/lib/PandoraFMS/DataServer.pm b/pandora_server/lib/PandoraFMS/DataServer.pm index 485e21166b..b03512983b 100644 --- a/pandora_server/lib/PandoraFMS/DataServer.pm +++ b/pandora_server/lib/PandoraFMS/DataServer.pm @@ -462,6 +462,13 @@ sub process_xml_data ($$$$$) { my $module_name = get_tag_value ($module_data, 'name', ''); + # Clean module_name because sometimes due to errors or problems + # creating XMLs it could contain carriage returns and later they + # are a pain when you update module configuration because the name won't + # save the carriage return. + $module_name =~ s/\r//g; + $module_name =~ s/\n//g; + # Unnamed module next if ($module_name eq '');