diff --git a/modules/comment.module b/modules/comment.module index b72507769757b9f14386eefa4f94cd659ba301b8..be7aab813b7a0fe85dd76cb2704953f8ada5d580 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -1166,10 +1166,11 @@ function comment_validate($edit) { // Invoke other validation handlers comment_invoke_comment($edit, 'validate'); - $check_date = strtotime($date); - // As of PHP 5.1.0, strtotime returns FALSE upon failure instead of -1. - if ($check_date === FALSE || $check_date === -1) { - form_set_error('date', t('You have to specify a valid date.')); + if (isset($edit['date'])) { + // As of PHP 5.1.0, strtotime returns FALSE upon failure instead of -1. + if (strtotime($edit['date']) <= 0) { + form_set_error('date', t('You have to specify a valid date.')); + } } if (isset($edit['author']) && !$account = user_load(array('name' => $edit['author']))) { form_set_error('author', t('You have to specify a valid author.')); diff --git a/modules/comment/comment.module b/modules/comment/comment.module index b72507769757b9f14386eefa4f94cd659ba301b8..be7aab813b7a0fe85dd76cb2704953f8ada5d580 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1166,10 +1166,11 @@ function comment_validate($edit) { // Invoke other validation handlers comment_invoke_comment($edit, 'validate'); - $check_date = strtotime($date); - // As of PHP 5.1.0, strtotime returns FALSE upon failure instead of -1. - if ($check_date === FALSE || $check_date === -1) { - form_set_error('date', t('You have to specify a valid date.')); + if (isset($edit['date'])) { + // As of PHP 5.1.0, strtotime returns FALSE upon failure instead of -1. + if (strtotime($edit['date']) <= 0) { + form_set_error('date', t('You have to specify a valid date.')); + } } if (isset($edit['author']) && !$account = user_load(array('name' => $edit['author']))) { form_set_error('author', t('You have to specify a valid author.'));