WordPress.org

Make WordPress Core

Ticket #7821: patch_comment_moderation_link_count.diff

File patch_comment_moderation_link_count.diff, 748 bytes (added by tott, 6 years ago)

patch wp-includes/comment.php against rev:9196

  • wp-includes/comment.php

     
    4545        if ( 1 == get_option('comment_moderation') ) 
    4646                return false; // If moderation is set to manual 
    4747 
    48         if ( get_option('comment_max_links') && preg_match_all("|(href\t*?=\t*?['\"]?)?(https?:)?//|i", $comment, $out) >= get_option('comment_max_links') ) 
     48        if ( get_option('comment_max_links') && preg_match_all("/<[Aa][^>]*[Hh][Rr][Ee][Ff]=['\"]([^\"'>]+)[^>]*>/", apply_filters('comment_text',$comment), $out) >= get_option('comment_max_links') ) 
    4949                return false; // Check # of external links 
    5050 
    5151        $mod_keys = trim(get_option('moderation_keys'));