comment_form_validate

Versions
4.7 – 5
comment_form_validate($form_id, $form_values)
6 – 7
comment_form_validate($form, &$form_state)

Validate comment form submissions.

Code

modules/comment/comment.module, line 1489

<?php
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']);
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.