Changeset 26069 for extensions/EasyCaptcha/include/guestbook.inc.php
- Timestamp:
- Dec 21, 2013, 6:37:54 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/EasyCaptcha/include/guestbook.inc.php
r26068 r26069 2 2 defined('EASYCAPTCHA_ID') or die('Hacking attempt!'); 3 3 4 $conf['EasyCaptcha']['template'] = 'guestbook'; 4 5 include(EASYCAPTCHA_PATH.'include/common.inc.php'); 5 add_event_handler('loc_begin_index', 'add_easycaptcha'); 6 6 7 add_event_handler('user_comment_check', 'check_easycaptcha', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 7 8 function add_easycaptcha()9 {10 global $template;11 $template->set_prefilter('guestbook', 'prefilter_easycaptcha');12 }13 14 function prefilter_easycaptcha($content, $smarty)15 {16 $search = '#{\$comment_add\.CONTENT}</textarea>(\s*)</td>(\s*)</tr>#';17 $replace = '{\$comment_add.CONTENT}</textarea>$1</td>$2</tr>'."\n".'{\$EASYCAPTCHA_CONTENT}';18 return preg_replace($search, $replace, $content);19 }20 8 21 9 function check_easycaptcha($action, $comment)
Note: See TracChangeset
for help on using the changeset viewer.