mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-15 07:05:37 +01:00
don't time-throttle comments from Administrators
git-svn-id: http://svn.automattic.com/wordpress/trunk@7425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4ebfe93ca2
commit
fda19a41bf
@ -377,6 +377,8 @@ function wp_allow_comment($commentdata) {
|
|||||||
*/
|
*/
|
||||||
function check_comment_flood_db( $ip, $email, $date ) {
|
function check_comment_flood_db( $ip, $email, $date ) {
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
|
if ( current_user_can( 'manage_options' ) )
|
||||||
|
return; // don't throttle admins
|
||||||
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") ) {
|
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") ) {
|
||||||
$time_lastcomment = mysql2date('U', $lasttime);
|
$time_lastcomment = mysql2date('U', $lasttime);
|
||||||
$time_newcomment = mysql2date('U', $date);
|
$time_newcomment = mysql2date('U', $date);
|
||||||
|
Loading…
Reference in New Issue
Block a user