Changeset 5947
- Timestamp:
- 08/27/2007 06:34:18 AM (17 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 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) { -
trunk/wp-includes/default-filters.php
r5937 r5947 107 107 add_filter('pre_kses', 'wp_pre_kses_less_than'); 108 108 add_filter('sanitize_title', 'sanitize_title_with_dashes'); 109 add_action('check_comment_flood', 'check_comment_flood_db', 10, 3); 109 110 add_filter('comment_flood_filter', 'wp_throttle_comment_flood', 10, 3); 110 111 add_filter('pre_comment_content', 'wp_rel_nofollow', 15);
Note: See TracChangeset
for help on using the changeset viewer.