Code:
foreach($_POST as $cfgID => $cfgValue) {
$strpos = strpos($cfgID, 'cfg_');
if ($strpos !== FALSE) {
$cID = zen_db_prepare_input(substr($cfgID, $strpos + 4));
$configuration_value = zen_db_prepare_input($cfgValue);
AFTER this section add this:
Code:
// START fix code to correctly utilize the use_function
$queryResult = $db->Execute(
'SELECT `use_function` FROM `' . $configuration_table . '` ' .
'WHERE `configuration_id`=\'' . $cID . '\''
);
if(!$queryResult->EOF && zen_not_null($queryResult->fields['use_function'])) {
$use_function = $queryResult->fields['use_function'];
if (preg_match('/->/', $use_function)) {
$class_method = explode('->', $use_function);
if (!is_object(${$class_method[0]})) {
include(DIR_WS_CLASSES . $class_method[0] . '.php');
${$class_method[0]} = new $class_method[0]();
}
$configuration_value = zen_call_function($class_method[1], $configuration_value, ${$class_method[0]});
} else {
$configuration_value = zen_call_function($use_function, $configuration_value);
}
}
unset($queryResult, $use_function);
// END fix code to correctly utilize the use_function
Bookmarks