Merge branch 'ent-12498-widget-top-n-of-agent-modules-no-muestra-resultados-de-todos-los-agentes' into 'develop'

Ent 12498 Widget TOP N of Agent Modules no muestra resultados de TODOS los agentes

See merge request artica/pandorafms!6695
This commit is contained in:
Rafael Ameijeiras 2023-11-29 14:22:48 +00:00
commit 2e0d732eb9
1 changed files with 14 additions and 0 deletions

View File

@ -420,6 +420,20 @@ class TopNWidget extends Widget
// Prevent double safe input in agents_get_group_agents function.
$agentRegex = io_safe_output($agentRegex);
// Validate regex.
if (@preg_match('/'.$agentRegex.'/', '') === false
|| @preg_match('/'.$this->values['module'].'/', '') === false
) {
$output .= '<div class="container-center">';
$output .= \ui_print_info_message(
__('Invalid regex'),
'',
true
);
$output .= '</div>';
return $output;
}
// This function check ACL.
$agents = @agents_get_group_agents(0, ['aliasRegex' => $agentRegex]);
$agentsId = \array_keys($agents);