Skip to:
Content

bbPress.org

Ticket #2546: 2546.diff

File 2546.diff, 1.6 KB (added by netweb, 7 years ago)
  • src/includes/common/functions.php

     
    787787        $_post     = array();
    788788        $match_out = '';
    789789
    790         /** Blacklist *************************************************************/
    791 
    792         // Get the moderation keys
    793         $blacklist = trim( get_option( 'moderation_keys' ) );
    794 
    795         // Bail if blacklist is empty
    796         if ( empty( $blacklist ) )
    797                 return true;
    798 
    799790        /** User Data *************************************************************/
    800791
    801792        // Map anonymous user data
     
    829820        /** Max Links *************************************************************/
    830821
    831822        $max_links = get_option( 'comment_max_links' );
    832         if ( !empty( $max_links ) ) {
     823        if ( ! empty( $max_links ) ) {
    833824
    834825                // How many links?
    835                 $num_links = preg_match_all( '/<a [^>]*href/i', $content, $match_out );
     826                $num_links = preg_match_all( '/(http|ftp|https):\/\//i', $content, $match_out );
    836827
    837828                // Allow for bumping the max to include the user's URL
    838829                $num_links = apply_filters( 'comment_max_links_url', $num_links, $_post['url'] );
     
    843834                }
    844835        }
    845836
     837        /** Blacklist *************************************************************/
     838
     839        // Get the moderation keys
     840        $blacklist = trim( get_option( 'moderation_keys' ) );
     841
     842        // Bail if blacklist is empty
     843        if ( empty( $blacklist ) ) {
     844                return true;
     845        }
     846
    846847        /** Words *****************************************************************/
    847848
    848849        // Get words separated by new lines