diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 1159434648..ae718c96bd 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1135,15 +1135,15 @@ function events_get_all( } else { if ($filter['custom_data_filter_type'] === '1') { $sql_filters[] = sprintf( - ' AND JSON_VALID(custom_data) = 1 AND JSON_EXTRACT(custom_data, "$.*") LIKE lower("%%%s%%") ', - $filter['custom_data'], - $filter['custom_data'] + ' AND JSON_VALID(custom_data) = 1 + AND cast(JSON_EXTRACT(custom_data, "$.*") as CHAR) LIKE lower("%%%s%%") ', + io_safe_output($filter['custom_data']) ); } else { $sql_filters[] = sprintf( - ' AND JSON_VALID(custom_data) = 1 AND JSON_KEYS(custom_data) REGEXP "%s" ', - $filter['custom_data'], - $filter['custom_data'] + ' AND JSON_VALID(custom_data) = 1 + AND cast(JSON_KEYS(custom_data) as CHAR) REGEXP "%s" ', + io_safe_output($filter['custom_data']) ); } }