Make WordPress Core

Changeset 13150


Ignore:
Timestamp:
02/14/2010 10:59:37 AM (15 years ago)
Author:
nacin
Message:

Adjust regex for counting links in a comment when checking if it needs to be held for moderation. Also fix notice in wp_new_comment(). see #11830

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/comment.php

    r12733 r13150  
    4646        return false; // If moderation is set to manual
    4747
    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') )
     48    if ( get_option( 'comment_max_links' ) && preg_match_all( '/<a [^>]*href/i', apply_filters( 'comment_text', $comment ), $out) >= get_option( 'comment_max_links' ) )
    4949        return false; // Check # of external links
    5050
     
    12681268        $post = &get_post($commentdata['comment_post_ID']); // Don't notify if it's your own comment
    12691269
    1270         if ( get_option('comments_notify') && $commentdata['comment_approved'] && $post->post_author != $commentdata['user_id'] )
     1270        if ( isset( $commentdata['user_id'] ) && get_option('comments_notify') && $commentdata['comment_approved'] && $post->post_author != $commentdata['user_id'] )
    12711271            wp_notify_postauthor($comment_ID, $commentdata['comment_type']);
    12721272    }
Note: See TracChangeset for help on using the changeset viewer.