Merge branch 'ent-3199-Parsear-espacios-al-final-y-caracteres-especiales-al-introducir-nombre-agente-en-consola' into 'develop'

3199-Parsear-espacios-al-final-y-caracteres-especiales-al-introducir-nombre-agente-en-consola into develop

See merge request artica/pandorafms!2193

Former-commit-id: c6e976b78254e6b5b82dddf206c419737bd99a83
This commit is contained in:
Alejandro Fraguas 2019-02-22 10:01:43 +01:00
commit e55915e1e2
2 changed files with 5 additions and 5 deletions

View File

@ -229,7 +229,7 @@ if (!$new_agent) {
$table->data[0][1] .= "&nbsp;&nbsp;<span align='right'><a onClick=\"if (!confirm('".__('Are you sure?')."')) return false;\" href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&borrar_agente=$id_agente&search=&offset=0&sort_field=&sort=none'>".html_print_image('images/cross.png', true, ['title' => __('Delete agent')]).'</a>';
}
$table->data[1][0] = __('Alias').ui_print_help_tip(__('Characters /,\,|,%,#,&,$ are not allowed'), true).'</span>';
$table->data[1][0] = __('Alias').ui_print_help_tip(__('Characters /,\,|,%,#,&,$ will be ignored'), true).'</span>';
$table->data[1][1] = html_print_input_text('alias', $alias, '', 50, 100, true);
if ($new_agent) {
$table->data[1][1] .= html_print_checkbox('alias_as_name', 1, $config['alias_as_name'], true).__('Use alias as name');

View File

@ -159,8 +159,8 @@ $module_macros = [];
// Create agent
if ($create_agent) {
$mssg_warning = 0;
$alias = trim (preg_replace('/[\/\\\|%#&$-]/', '',
html_entity_decode( str_replace('`','&lsquo;',(string) get_parameter_post ("alias", "")))));
$alias_safe_output = io_safe_output(get_parameter("alias",""));
$alias = io_safe_input(trim (preg_replace('/[\/\\\|%#&$-]/', '', $alias_safe_output)));
$alias_as_name = (int) get_parameter_post('alias_as_name', 0);
$direccion_agente = (string) get_parameter_post('direccion', '');
$unique_ip = (int) get_parameter_post('unique_ip', 0);
@ -765,8 +765,8 @@ if ($update_agent) {
$mssg_warning = 0;
$id_agente = (int) get_parameter_post('id_agente');
$nombre_agente = str_replace('`', '&lsquo;', (string) get_parameter_post('agente', ''));
$alias = trim (preg_replace('/[\/\\\|%#&$-]/', '',
html_entity_decode( str_replace('`','&lsquo;',(string) get_parameter_post ("alias", "")))));
$alias_safe_output = io_safe_output(get_parameter("alias",""));
$alias = io_safe_input(trim (preg_replace('/[\/\\\|%#&$-]/', '', $alias_safe_output)));
$alias_as_name = (int) get_parameter_post('alias_as_name', 0);
$direccion_agente = (string) get_parameter_post('direccion', '');
$unique_ip = (int) get_parameter_post('unique_ip', 0);