diff options
author | Dries Buytaert <dries@buytaert.net> | 2006-01-26 08:48:57 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2006-01-26 08:48:57 +0000 |
commit | 20154df528fefb072663037256ecbccb29bac7f5 (patch) | |
tree | cc12cd717751f6cc49869078dac7a2d92bb5675a /modules/comment.module | |
parent | 017cbf5e2bc31c49a9bca28c7a127961bbf9c27f (diff) | |
download | brdo-20154df528fefb072663037256ecbccb29bac7f5.tar.gz brdo-20154df528fefb072663037256ecbccb29bac7f5.tar.bz2 |
- Modified patch #45723 by wtanaka: creating a comment, editing a comment, or anything that validates a comment fails on PHP5.
Diffstat (limited to 'modules/comment.module')
-rw-r--r-- | modules/comment.module | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/comment.module b/modules/comment.module index b72507769..be7aab813 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.')); |