Original geschrieben von onemorenerd
@arkos: Masochist!
@arkos: Masochist!
OffTopic:
... fühl mich so erwischt
function safetpl($file) {
$tpl = file_get_contents($file);
foreach (token_get_all('<'.'?php '.$tpl.' ?'.'>') as $t)
if ($t[0] == T_GLOBAL || $t[0] == T_FUNCTION || $t[0] == T_CLASS)
die('unsafe template');
unset($_GET, $_POST, $_SESSION, $_COOKIE, $_ENV, $GLOBALS);
return eval('?'.'>'.$tpl);
}
Kommentar