Merge branch 'ent-13251-cli-pfms-el-comando-update_agente-con-opcion-custom_id-y-campo-ip-address-permite-inyectar' into 'develop'

Ent-13251-cli-pfms-el-comando-update_agente-con-opcion-custom_id-y-campo-ip-address-permite-inyectar

See merge request artica/pandorafms!7128
This commit is contained in:
Jose Martin 2024-04-04 07:27:05 +00:00
commit 2f75231cb8
3 changed files with 7 additions and 0 deletions

View File

@ -90,6 +90,10 @@ function io_safe_input($value)
$value = utf8_encode($value);
}
if (preg_match('/<\/?script(.*?)>/', $value)) {
$value = preg_replace('/<\/?script(.*?)>/', '', $value);
}
$valueHtmlEncode = htmlentities(($value ?? ''), ENT_QUOTES, 'UTF-8', true);
// Replace the character '\' for the equivalent html entitie

View File

@ -648,6 +648,7 @@ sub safe_input($) {
return "" unless defined($value);
$value =~ s/<\/?script(.*?)>//gs;
$value =~ s/(.)/$CHR2ENT{$1}||$1/ge;
return $value;

View File

@ -3429,6 +3429,8 @@ sub cli_agent_update() {
my @id_agents;
my $id_agent;
$new_value = safe_input($new_value);
if (defined $use_alias and $use_alias eq 'use_alias') {
@id_agents = get_agent_ids_from_alias($dbh,$agent_name);
foreach my $id (@id_agents) {