diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control
index 1ea64ff29f..41fc04fc3b 100644
--- a/pandora_agents/unix/DEBIAN/control
+++ b/pandora_agents/unix/DEBIAN/control
@@ -1,5 +1,5 @@
package: pandorafms-agent-unix
-Version: 5.1SP1-141006
+Version: 5.1SP1-141007
Architecture: all
Priority: optional
Section: admin
diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh
index 4e9cc573b2..d07cf0f740 100644
--- a/pandora_agents/unix/DEBIAN/make_deb_package.sh
+++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-pandora_version="5.1SP1-141006"
+pandora_version="5.1SP1-141007"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent
index 1307674422..92c3e02654 100644
--- a/pandora_agents/unix/pandora_agent
+++ b/pandora_agents/unix/pandora_agent
@@ -41,7 +41,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '5.1SP1';
-use constant AGENT_BUILD => '141006';
+use constant AGENT_BUILD => '141007';
# Commands to retrieve total memory information in kB
use constant TOTALMEMORY_CMDS => {
diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec
index ed48019596..cb1e2ed08c 100644
--- a/pandora_agents/unix/pandora_agent.redhat.spec
+++ b/pandora_agents/unix/pandora_agent.redhat.spec
@@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 5.1SP1
-%define release 141006
+%define release 141007
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}
diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec
index 3f85c74f1b..78e5fda936 100644
--- a/pandora_agents/unix/pandora_agent.spec
+++ b/pandora_agents/unix/pandora_agent.spec
@@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 5.1SP1
-%define release 141006
+%define release 141007
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}
diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi
index 070369275b..cc317f3356 100644
--- a/pandora_agents/win32/installer/pandora.mpi
+++ b/pandora_agents/win32/installer/pandora.mpi
@@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
-{141006}
+{141007}
ViewReadme
{Yes}
diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc
index cef86090e5..8df566e1c9 100644
--- a/pandora_agents/win32/pandora.cc
+++ b/pandora_agents/win32/pandora.cc
@@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
-#define PANDORA_VERSION ("5.1SP1(Build 141006)")
+#define PANDORA_VERSION ("5.1SP1(Build 141007)")
string pandora_path;
string pandora_dir;
diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc
index d9e064b12b..f234182797 100644
--- a/pandora_agents/win32/versioninfo.rc
+++ b/pandora_agents/win32/versioninfo.rc
@@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
- VALUE "ProductVersion", "(5.1SP1(Build 141006))"
+ VALUE "ProductVersion", "(5.1SP1(Build 141007))"
VALUE "FileVersion", "1.0.0.0"
END
END
diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control
index b5b6c77bf0..519399e4f8 100644
--- a/pandora_console/DEBIAN/control
+++ b/pandora_console/DEBIAN/control
@@ -1,5 +1,5 @@
package: pandorafms-console
-Version: 5.1SP1-141006
+Version: 5.1SP1-141007
Architecture: all
Priority: optional
Section: admin
diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh
index 2fd50d177a..2b7ee5d217 100644
--- a/pandora_console/DEBIAN/make_deb_package.sh
+++ b/pandora_console/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-pandora_version="5.1SP1-141006"
+pandora_version="5.1SP1-141007"
package_pear=0
package_pandora=1
diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php
index 3f7db9721c..6bae453c10 100644
--- a/pandora_console/include/config_process.php
+++ b/pandora_console/include/config_process.php
@@ -22,7 +22,7 @@
/**
* Pandora build version and version
*/
-$build_version = 'PC141006';
+$build_version = 'PC141007';
$pandora_version = 'v5.1SP1';
// Do not overwrite default timezone set if defined.
diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php
index d62f94bc9a..80ddd70b6b 100644
--- a/pandora_console/include/functions_api.php
+++ b/pandora_console/include/functions_api.php
@@ -6584,7 +6584,7 @@ function api_set_add_event_comment($id, $thrash2, $other, $thrash3) {
return;
}
else if ($other['type'] == 'array') {
- $comment = $other['data'][0];
+ $comment = io_safe_input($other['data'][0]);
$meta = $other['data'][1];
$history = $other['data'][2];
diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php
index a2afc20e70..df781f4bd6 100644
--- a/pandora_console/include/functions_events.php
+++ b/pandora_console/include/functions_events.php
@@ -2270,7 +2270,7 @@ function events_page_comments ($event) {
$table_comments->class = "alternate rounded_cells";
$event_comments = io_safe_output($event["user_comment"]);
- $event_comments = str_replace("\n", "
", $event_comments);
+ $event_comments = str_replace( array("\n", '
'), "
", $event_comments);
// If comments are not stored in json, the format is old
$event_comments_array = json_decode($event_comments, true);
diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php
index eca97d4ada..3e108754de 100644
--- a/pandora_console/include/functions_modules.php
+++ b/pandora_console/include/functions_modules.php
@@ -349,8 +349,25 @@ function modules_delete_agent_module ($id_agent_module) {
* @return True if the module was updated. False if not.
*/
function modules_update_agent_module ($id, $values, $onlyNoDeletePending = false, $tags = false) {
+
+ $update_tags = false;
+ $return_tag = true;
+ if ($tags !== false) {
+ $update_tags = true;
+ $return_tag = tags_update_module_tag ($id, $tags);
+ }
+
+ if ($return_tag === false) {
+ return ERR_DB;
+ }
+
if (!is_array ($values) || empty ($values)) {
- return ERR_GENERIC;
+ if ($update_tags) {
+ return true;
+ }
+ else {
+ return ERR_GENERIC;
+ }
}
if (isset ($values['nombre'])) {
@@ -368,14 +385,7 @@ function modules_update_agent_module ($id, $values, $onlyNoDeletePending = false
}
}
- $return_tag = true;
- if ($tags !== false) {
- $return_tag = tags_update_module_tag ($id, $tags);
- }
- if ($return_tag === false) {
- return ERR_DB;
- }
$where = array();
$where['id_agente_modulo'] = $id;
diff --git a/pandora_console/install.php b/pandora_console/install.php
index 7c6e3e7577..776b699315 100644
--- a/pandora_console/install.php
+++ b/pandora_console/install.php
@@ -63,7 +63,7 @@