This commit is contained in:
miguel angel rasteu 2023-09-05 13:44:54 +02:00
parent 25175ce22e
commit 3bb4567dc3
3 changed files with 10 additions and 10 deletions

View File

@ -566,10 +566,10 @@ if ($search != '') {
if ($id != '') {
$aux = $id[0]['id_agent'];
$search_sql = sprintf(
' AND ( nombre LIKE "%%%s%%"
OR alias LIKE "%%%s%%"
OR comentarios LIKE "%%%s%%"
OR EXISTS (SELECT * FROM tagent_custom_data WHERE id_agent = id_agente AND description LIKE "%%%s%%")
' AND ( REPLACE(nombre, " ", " ") LIKE "%%%s%%"
OR REPLACE(alias, " ", " ") LIKE "%%%s%%"
OR REPLACE(comentarios, " ", " ") LIKE "%%%s%%"
OR EXISTS (SELECT * FROM tagent_custom_data WHERE id_agent = id_agente AND REPLACE(description, " ", " ") LIKE "%%%s%%")
OR tagente.id_agente = %d',
$search,
$search,
@ -591,10 +591,10 @@ if ($search != '') {
$search_sql .= ')';
} else {
$search_sql = sprintf(
' AND ( nombre
LIKE "%%%s%%" OR alias
LIKE "%%%s%%" OR comentarios LIKE "%%%s%%"
OR EXISTS (SELECT * FROM tagent_custom_data WHERE id_agent = id_agente AND description LIKE "%%%s%%"))',
' AND ( REPLACE(nombre, " ", " ")
LIKE "%%%s%%" OR REPLACE(alias, " ", " ")
LIKE "%%%s%%" OR REPLACE(comentarios, " ", " ") LIKE "%%%s%%"
OR EXISTS (SELECT * FROM tagent_custom_data WHERE id_agent = id_agente AND REPLACE(description, " ", " ") LIKE "%%%s%%"))',
$search,
$search,
$search,

View File

@ -574,7 +574,7 @@ $where = sprintf('delete_pending = 0 AND id_agente = %s', $id_agente);
$search_string_entities = io_safe_input($search_string);
$basic_where = sprintf(
"(nombre LIKE '%%%s%%' OR nombre LIKE '%%%s%%' OR descripcion LIKE '%%%s%%' OR descripcion LIKE '%%%s%%') AND",
"(REPLACE(nombre, ' ', ' ') LIKE '%%%s%%' OR REPLACE(nombre, ' ', ' ') LIKE '%%%s%%' OR REPLACE(descripcion, ' ', ' ') LIKE '%%%s%%' OR REPLACE(descripcion, ' ', ' ') LIKE '%%%s%%') AND",
$search_string,
$search_string_entities,
$search_string,

View File

@ -729,7 +729,7 @@ if ($search_id_group) {
}
if ($search_string != '') {
$filter[] = '(name LIKE '."'%".$search_string."%'".'OR description LIKE '."'%".$search_string."%'".'OR tcp_send LIKE '."'%".$search_string."%'".'OR tcp_rcv LIKE '."'%".$search_string."%'".')';
$filter[] = '(REPLACE(name, " ", " ") LIKE '."'%".$search_string."%'".' OR REPLACE(REPLACE(description, " ", " "), "&#x20", " ")LIKE '."'%".$search_string."%'".' OR REPLACE(tcp_send, " ", " ") LIKE '."'%".$search_string."%'".'OR REPLACE(tcp_rcv, " ", " ") LIKE '."'%".$search_string."%'".')';
}
$total_components = network_components_get_network_components(