Ticket #3352: bbp-3352.patch
File bbp-3352.patch, 1.1 KB (added by , 21 months ago) |
---|
-
src/includes/common/functions.php
901 901 902 902 // Only check max_links when not being strict 903 903 if ( false === $strict ) { 904 $max_links = get_option( 'comment_max_links' ); 904 // Get max number of links from WP core, with optional filter override 905 // https://bbpress.trac.wordpress.org/ticket/3352 906 $max_links = apply_filters( 'bbp_comment_max_links', get_option( 'comment_max_links' ) ); 905 907 if ( ! empty( $max_links ) ) { 906 908 907 909 // How many links? 908 910 $num_links = preg_match_all( '/(http|ftp|https):\/\//i', $content, $match_out ); 911 912 // Neutralize the current site's URL. 913 // https://bbpress.trac.wordpress.org/ticket/3352 914 if ( isset( $match_out[0] ) && is_array( $match_out[0] ) ) { 915 foreach ( $match_out[0] as $found_url ) { 916 if ( 0 === strpos( $found_url, home_url() ) ) { 917 $num_links -=1; 918 } 919 } 920 } 909 921 910 922 // Allow for bumping the max to include the user's URL 911 923 if ( ! empty( $_post['url'] ) ) {