From 9967d9da2a0b8516e111f5863e517144fe75cdd3 Mon Sep 17 00:00:00 2001 From: scribu Date: Sat, 13 Nov 2010 22:30:36 +0000 Subject: [PATCH] Always apply comment_text filter in check_comment(). Props hakre. Fixes #14680 git-svn-id: https://develop.svn.wordpress.org/trunk@16357 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/comment.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/comment.php b/wp-includes/comment.php index eee2a782ec..1b4d7b451d 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -45,9 +45,11 @@ function check_comment($author, $email, $url, $comment, $user_ip, $user_agent, $ if ( 1 == get_option('comment_moderation') ) return false; // If moderation is set to manual + $comment = apply_filters( 'comment_text', $comment ); + // Check # of external links if ( $max_links = get_option( 'comment_max_links' ) ) { - $num_links = preg_match_all( '/]*href/i', apply_filters( 'comment_text', $comment ), $out ); + $num_links = preg_match_all( '/]*href/i', $comment, $out ); $num_links = apply_filters( 'comment_max_links_url', $num_links, $url ); // provide for counting of $url as a link if ( $num_links >= $max_links ) return false;