From 9994477c06556692ce72706441f9b679ca48983c Mon Sep 17 00:00:00 2001 From: Shinichi Matsumoto Date: Fri, 3 Feb 2023 08:00:44 +0000 Subject: [PATCH] Change return value of function agents_get_agent_id_by_alias when alias is '' --- pandora_console/include/functions_agents.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 6e37a1e991..3b3bac283b 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -165,9 +165,9 @@ function agents_locate_agent(string $field) function agents_get_agent_id_by_alias($alias, $is_metaconsole=false) { if ($is_metaconsole === true) { - return db_get_all_rows_sql("SELECT id_tagente FROM tmetaconsole_agent WHERE upper(alias) LIKE upper('%$alias%')"); + return db_get_all_rows_sql("SELECT id_tagente FROM tmetaconsole_agent WHERE '$alias' != '' and upper(alias) LIKE upper('%$alias%')"); } else { - return db_get_all_rows_sql("SELECT id_agente FROM tagente WHERE upper(alias) LIKE upper('%$alias%')"); + return db_get_all_rows_sql("SELECT id_agente FROM tagente WHERE '$alias' != '' and upper(alias) LIKE upper('%$alias%')"); } }