diff options
author | Dries Buytaert <dries@buytaert.net> | 2005-10-08 12:21:47 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2005-10-08 12:21:47 +0000 |
commit | 7863be5e82ccfbaa4aa9bac2343ad9e560130b44 (patch) | |
tree | 4af8979d342a4ce8244fc005162f6d313692ab3d /modules/comment.module | |
parent | 27625fcf836b321f2999569d7d9508735388094e (diff) | |
download | brdo-7863be5e82ccfbaa4aa9bac2343ad9e560130b44.tar.gz brdo-7863be5e82ccfbaa4aa9bac2343ad9e560130b44.tar.bz2 |
- Patch #33433 by chx: fixed a number of form API problems.
* Default form value
* Leftover debug function in form.inc
* PHP5 issue with comment date (I got this patch from another issue)
* Validation error fix (was calling legacy form validate)
* Lots o' warnings on comment preview
* Filter tips plus argument (gremlins. I swear this was not there.)
* Message to clear what's going on with system settings
* Non-freetagging taxonomies fixed
Diffstat (limited to 'modules/comment.module')
-rw-r--r-- | modules/comment.module | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/comment.module b/modules/comment.module index d932b6214..3be3ef28d 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -417,8 +417,9 @@ function comment_validate(&$edit) { $edit['status'] = user_access('post comments without approval') ? 0 : 1; } else { - if (strtotime($edit['date']) != -1) { - $edit['timestamp'] = strtotime($edit['date']); + $date = isset($edit['date']) ? $edit['date'] : 'now'; + if (strtotime($date) != -1) { + $edit['timestamp'] = strtotime($date); } else { form_set_error('date', t('You have to specify a valid date.')); @@ -492,8 +493,6 @@ function comment_validate(&$edit) { } } } - // verify that this submission was actually generated using a local form - form_validate($edit, 'comment'. $edit['nid'] . $edit['pid']); return $edit; } @@ -522,7 +521,7 @@ function comment_preview($edit) { if (!form_get_errors()) { $output .= theme('comment_view', $comment); } - $output .= theme('comment_form', $edit, t('Reply')); + $output .= comment_form($edit, t('Reply')); if ($edit['pid']) { $comment = db_fetch_object(db_query('SELECT c.*, u.uid, u.name AS registered_name, u.picture, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = %d', $edit['pid'], COMMENT_PUBLISHED)); |