mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-22 15:31:42 +01:00
Always apply comment_text filter in check_comment(). Props hakre. Fixes #14680
git-svn-id: http://svn.automattic.com/wordpress/trunk@16357 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
68981ccac4
commit
9c4ab78301
@ -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( '/<a [^>]*href/i', apply_filters( 'comment_text', $comment ), $out );
|
||||
$num_links = preg_match_all( '/<a [^>]*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;
|
||||
|
Loading…
Reference in New Issue
Block a user