From dd9d0beded1bd4629d42dfc19d9779c9e819104e Mon Sep 17 00:00:00 2001 From: rvelices Date: Thu, 29 Mar 2012 18:48:41 +0000 Subject: fix email on comment requiring validation even if the options is unchecked git-svn-id: http://piwigo.org/svn/trunk@13800 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/functions_comment.inc.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/functions_comment.inc.php b/include/functions_comment.inc.php index 5f29be76e..4c884794a 100644 --- a/include/functions_comment.inc.php +++ b/include/functions_comment.inc.php @@ -47,8 +47,10 @@ function user_comment_check($action, $comment) } if ( $link_count>$conf['comment_spam_max_links'] ) + { + $_POST['cr'][] = 'links'; return $my_action; - + } return $action; } @@ -122,6 +124,7 @@ SELECT COUNT(*) AS user_exists if ( !verify_ephemeral_key(@$key, $comm['image_id']) ) { $comment_action='reject'; + $_POST['cr'][] = 'key'; // rvelices: I use this outside to see how spam robots work } if ($comment_action!='reject' and $conf['anti-flood_time']>0 and !is_admin()) @@ -165,7 +168,7 @@ INSERT INTO '.COMMENTS_TABLE.' $comm['id'] = pwg_db_insert_id(COMMENTS_TABLE); - if ($conf['email_admin_on_comment'] + if ( ($conf['email_admin_on_comment'] && 'validate' == $comment_action) or ($conf['email_admin_on_comment_validation'] and 'moderate' == $comment_action)) { include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); -- cgit v1.2.3