set_prefilter('register', 'prefilter_crypto'); } function prefilter_crypto($content, $smarty) { $search = '#\(\{\'useful when password forgotten\'\|(@?)translate\}\)(\s*)((?:\{/if\})?)#i'; $replace = '({\'useful when password forgotten\'|$1translate})$2$3'."\n".'{\$CRYPTO.parsed_content}'; return preg_replace($search, $replace, $content); } function check_crypto($errors) { include_once(CRYPTO_PATH.'securimage/securimage.php'); $securimage = new Securimage(); if ($securimage->check($_POST['captcha_code']) == false) { $errors[] = l10n('Invalid Captcha'); } return $errors; }