Ticket #2759: silence_gethostbyaddr.diff

File silence_gethostbyaddr.diff, 1.1 kB (added by markjaquith, 2 years ago)

Patch for /trunk/

  • wp-includes/pluggable.php

    old new  
    337337 
    338338        if ('' == $user->user_email) return false; // If there's no email to send the comment to 
    339339 
    340         $comment_author_domain = gethostbyaddr($comment->comment_author_IP); 
     340        $comment_author_domain = @gethostbyaddr($comment->comment_author_IP); 
    341341 
    342342        $blogname = get_option('blogname'); 
    343343 
     
    415415        $comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID='$comment_id' LIMIT 1"); 
    416416        $post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID='$comment->comment_post_ID' LIMIT 1"); 
    417417 
    418         $comment_author_domain = gethostbyaddr($comment->comment_author_IP); 
     418        $comment_author_domain = @gethostbyaddr($comment->comment_author_IP); 
    419419        $comments_waiting = $wpdb->get_var("SELECT count(comment_ID) FROM $wpdb->comments WHERE comment_approved = '0'"); 
    420420 
    421421        $notify_message  = sprintf( __('A new comment on the post #%1$s "%2$s" is waiting for your approval'), $post->ID, $post->post_title ) . "\r\n";