/** * Applies CSRF filter on Smarty template content. Can be * used as a output filter. * * @param string $source * @param Smarty $smarty * @return CSRF filtered content */ function smarty_csrf_filter($source, &$smarty) { return csrfguard_replace_forms($source); }
function csrfguard_inject() { $data = ob_get_clean(); $data = csrfguard_replace_forms($data); echo $data; }