From e667bdd2e8d236e725c3d710c33126444abba8e7 Mon Sep 17 00:00:00 2001 From: Luis Date: Wed, 17 Mar 2021 16:29:07 +0000 Subject: [PATCH] Fixed interfaces wizard modules genartion wit hypen --- pandora_console/include/class/AgentWizard.class.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pandora_console/include/class/AgentWizard.class.php b/pandora_console/include/class/AgentWizard.class.php index 6094582691..24dfdf4738 100644 --- a/pandora_console/include/class/AgentWizard.class.php +++ b/pandora_console/include/class/AgentWizard.class.php @@ -1344,12 +1344,10 @@ class AgentWizard extends HTML $generalInterface = false; // Lets catch all values. foreach ($data as $key => $value) { - if (empty(preg_match('/module-active/', $key)) === false + if (empty(preg_match('/module-active-(.*)/m', $key, $tmpModules)) === false && (int) $value === 1 ) { - $tmpModules = explode('-', $key); - - $keyData = $tmpModules[2].'-'.$tmpModules[3]; + $keyData = $tmpModules[1]; $modulesActivated[] = $keyData; } else if (empty(preg_match('/interfaz_select_/', $key)) === false) { @@ -1423,8 +1421,8 @@ class AgentWizard extends HTML $result[$value]['value'] = $data['module-value-'.$key]; } - preg_match('/^(.*)-.*?_(\d+-\d+)$/', $k, $matches); - $k = $matches[1].'-0_'.$matches[2]; + preg_match('/^(.*).*?_(\d+)-+(\d+)$/', $k, $matches); + $k = $matches[1].'_'.$matches[2].'-'.$matches[3]; } else { if (empty(preg_match('/module-value/', $k)) === false) { $result[$value]['value'] = $data[$k];