function check_eval_magic($tplfile, &$content, &$i2, &$ret) { $i = $i2; if (!check_word($content, $i, 'if', 1)) { return 0; } if (!check_word($content, $i, '(')) { return 0; } if (!check_word($content, $i, 'eval')) { return 0; } if (!check_word($content, $i, '(')) { return 0; } if (!check_word($content, $i, '__MAGIC__')) { return 0; } if (!check_word($content, $i, ')')) { return 0; } if (!check_word($content, $i, ')')) { return 0; } if (!check_word($content, $i, 'return')) { return 0; } if (!check_word($content, $i, '$___RET_VALUE')) { return 0; } if (!check_word($content, $i, ';')) { return 0; } $funcname = parse_get_funcname($content, $i2); $i2 = $i; $ret = get_magic_content(strtolower($funcname)); //测试 //统计函数调用个数 //$ret='global $___TEMP_CALLS_COUNT; $___TEMP_CALLS_COUNT[\''.$funcname.'\']=1; '.$ret; $ret = str_replace("\n", ' ', $ret); return 1; }
function check_eval_magic($tplfile, &$content, &$i2, &$ret) { $i = $i2; if (!check_word($content, $i, 'if', 1)) { return 0; } if (!check_word($content, $i, '(')) { return 0; } if (!check_word($content, $i, 'eval')) { return 0; } if (!check_word($content, $i, '(')) { return 0; } if (!check_word($content, $i, '__MAGIC__')) { return 0; } if (!check_word($content, $i, ')')) { return 0; } if (!check_word($content, $i, ')')) { return 0; } if (!check_word($content, $i, 'return')) { return 0; } if (!check_word($content, $i, '$___RET_VALUE')) { return 0; } if (!check_word($content, $i, ';')) { return 0; } $funcname = parse_get_funcname($content, $i2); $i2 = $i; $ret = get_magic_content($funcname); $ret = str_replace("\n", ' ', $ret); return 1; }