function comment_form_validate in Drupal 6
Same name and namespace in other branches
- 4 modules/comment.module \comment_form_validate()
- 5 modules/comment/comment.module \comment_form_validate()
- 7 modules/comment/comment.module \comment_form_validate()
Validate comment form submissions.
File
- modules/
comment/ comment.module, line 1489 - Enables users to comment on published content.
Code
function comment_form_validate($form, &$form_state) {
global $user;
if ($user->uid === 0) {
foreach (array(
'name',
'homepage',
'mail',
) as $field) {
// Set cookie for 365 days.
if (isset($form_state['values'][$field])) {
setcookie('comment_info_' . $field, $form_state['values'][$field], time() + 31536000, '/');
}
}
}
comment_validate($form_state['values']);
}