Ticket #3175: vroom_vroom.diff
| File vroom_vroom.diff, 1.8 kB (added by markjaquith, 2 years ago) |
|---|
-
wp-includes/default-filters.php
old new 38 38 39 39 add_filter('comment_email', 'antispambot'); 40 40 41 add_filter('comment_flood_filter', 'wp_throttle_comment_flood', 10, 3); 42 41 43 add_filter('comment_url', 'clean_url'); 42 44 43 45 add_filter('comment_text', 'convert_chars'); -
wp-includes/comment.php
old new 187 187 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") ) { 188 188 $time_lastcomment = mysql2date('U', $lasttime); 189 189 $time_newcomment = mysql2date('U', $comment_date_gmt); 190 if ( ($time_newcomment - $time_lastcomment) < 15 ) { 190 $flood_die = apply_filters('comment_flood_filter', false, $time_lastcomment, $time_newcomment); 191 if ( $flood_die ) { 191 192 do_action('comment_flood_trigger', $time_lastcomment, $time_newcomment); 192 wp_die( __(' Sorry, you can only post a new comment once every 15 seconds. Slow down cowboy.') );193 wp_die( __('You are posting comments too quickly. Slow down.') ); 193 194 } 194 195 } 195 196 … … 355 356 return $commentdata; 356 357 } 357 358 359 function wp_throttle_comment_flood($block, $time_lastcomment, $time_newcomment) { 360 if ( $block ) // a plugin has already blocked... we'll let that decision stand 361 return $block; 362 if ( ($time_newcomment - $time_lastcomment) < 15 ) 363 return true; 364 return false; 365 } 366 358 367 function wp_new_comment( $commentdata ) { 359 368 $commentdata = apply_filters('preprocess_comment', $commentdata); 360 369
