Commit e2ed1613 authored by greggles's avatar greggles

feature #171034 by greggles: if emails are not required by drupal, validate...

feature #171034 by greggles: if emails are not required by drupal, validate the comment submit form to require emails if they try to get comment notification
parent d6e3b234
......@@ -225,6 +225,12 @@ function comment_notify_comment($comment, $op) {
global $user;
switch ($op) {
case 'validate':
// We assume that if they are non-anonymous then they have a valid mail
if (!$user->uid && $comment['notify'] && empty($comment['mail'])) {
form_set_error('mail', t('If you want to subscribe to comments you must supply a valid e-mail address.'));
}
break;
case 'publish':
_comment_notify_mailalert($comment);
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment