Changeset 4265
- Timestamp:
- 10/02/2006 06:19:44 PM (19 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/comment.php
r4196 r4265 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 } … … 354 355 $commentdata['filtered'] = true; 355 356 return $commentdata; 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; 356 365 } 357 366 -
trunk/wp-includes/default-filters.php
r4201 r4265 38 38 39 39 add_filter('comment_email', 'antispambot'); 40 41 add_filter('comment_flood_filter', 'wp_throttle_comment_flood', 10, 3); 40 42 41 43 add_filter('comment_url', 'clean_url');
Note: See TracChangeset
for help on using the changeset viewer.