- else { $evalcode = $ds['update']; }
- if (preg_match('/^\s*function\s+{(.*)}\s*$/is', $evalcode, $regs)) {
- $upfunc = create_function('', $regs[1]);
- $val = $upfunc();
- }
- elseif (!is_null($evalcode)) {
- ob_start();
- eval($evalcode);
- $val = ob_get_contents();
- ob_end_clean();
+ else {
+ if (preg_match('/^\s*function\s+{(.*)}\s*$/is', $ds['update'], $regs)) {
+ $evalcode = '$upfunc = function() {'."\n".$regs[1]."\n".'};'."\n".'print($upfunc());';
+ }
+ else {
+ $evalcode = $ds['update'];
+ }
+ if (!is_null($evalcode)) {
+ ob_start();
+ eval($evalcode);
+ $val = ob_get_contents();
+ ob_end_clean();
+ }