Changeset 5947 for trunk/wp-includes/comment.php
- Timestamp:
- 08/27/2007 06:34:18 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/comment.php
r5885 r5947 192 192 wp_die( __('Duplicate comment detected; it looks as though you\'ve already said that!') ); 193 193 194 // Simple flood-protection 195 if ( $lasttime = $wpdb->get_var("SELECT comment_date_gmt FROM $wpdb->comments WHERE comment_author_IP = '$comment_author_IP' OR comment_author_email = '$comment_author_email' ORDER BY comment_date DESC LIMIT 1") ) { 196 $time_lastcomment = mysql2date('U', $lasttime); 197 $time_newcomment = mysql2date('U', $comment_date_gmt); 198 $flood_die = apply_filters('comment_flood_filter', false, $time_lastcomment, $time_newcomment); 199 if ( $flood_die ) { 200 do_action('comment_flood_trigger', $time_lastcomment, $time_newcomment); 201 wp_die( __('You are posting comments too quickly. Slow down.') ); 202 } 203 } 194 do_action( 'check_comment_flood', $comment_author_IP, $comment_author_email, $comment_date_gmt ); 204 195 205 196 if ( $user_id ) { … … 226 217 } 227 218 219 function check_comment_flood_db( $ip, $email, $date ) { 220 global $wpdb; 221 if ( $lasttime = $wpdb->get_var("SELECT comment_date_gmt FROM $wpdb->comments WHERE comment_author_IP = '$ip' OR comment_author_email = '$email' ORDER BY comment_date DESC LIMIT 1") ) { 222 $time_lastcomment = mysql2date('U', $lasttime); 223 $time_newcomment = mysql2date('U', $date); 224 $flood_die = apply_filters('comment_flood_filter', false, $time_lastcomment, $time_newcomment); 225 if ( $flood_die ) { 226 do_action('comment_flood_trigger', $time_lastcomment, $time_newcomment); 227 wp_die( __('You are posting comments too quickly. Slow down.') ); 228 } 229 } 230 } 228 231 229 232 function wp_blacklist_check($author, $email, $url, $comment, $user_ip, $user_agent) {
Note: See TracChangeset
for help on using the changeset viewer.