mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
Merge branch 'ent-1783-cde-contenedores-de-graficas' into 'develop'
Test REGEXP is valid before apply in MySQL See merge request artica/pandorafms!3885
This commit is contained in:
commit
b4fc2a47e9
@ -253,7 +253,12 @@ if ($get_graphs) {
|
|||||||
|
|
||||||
case 'dynamic_graph':
|
case 'dynamic_graph':
|
||||||
if ($value['agent'] != '') {
|
if ($value['agent'] != '') {
|
||||||
$alias = " AND alias REGEXP '".$value['agent']."'";
|
if (@preg_match($value['agent'], '') !== false) {
|
||||||
|
$alias = " AND alias REGEXP '".$value['agent']."'";
|
||||||
|
} else {
|
||||||
|
// Not a valid REGEXP.
|
||||||
|
$alias = " AND alias LIKE '".$value['agent']."'";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($value['id_group'] === '0') {
|
if ($value['id_group'] === '0') {
|
||||||
@ -277,7 +282,11 @@ if ($get_graphs) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($value['module'] != '') {
|
if ($value['module'] != '') {
|
||||||
$module_name = " AND nombre REGEXP '".$value['module']."'";
|
if (@preg_match($value['module'], '') !== false) {
|
||||||
|
$module_name = " AND nombre REGEXP '".$value['module']."'";
|
||||||
|
} else {
|
||||||
|
$module_name = " AND nombre LIKE '".$value['module']."'";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$id_agent_module = db_get_all_rows_sql(
|
$id_agent_module = db_get_all_rows_sql(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user