Make WordPress Core


Ignore:
Timestamp:
03/21/2004 08:31:33 AM (21 years ago)
Author:
saxmatt
Message:

New comment moderation code, for trackbacks and comments.

File:
1 edited

Legend:

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

    r982 r984  
    15651565}
    15661566
     1567function check_comment($author, $email, $url, $comment, $user_ip) {
     1568    $words = explode("\n", get_settings('moderation_keys') );
     1569    foreach ($words as $word) {
     1570    $word = trim($word);
     1571    $pattern = "#$word#i";
     1572        if ( preg_match($pattern, $author) ) return false;
     1573        if ( preg_match($pattern, $email) ) return false;
     1574        if ( preg_match($pattern, $url) ) return false;
     1575        if ( preg_match($pattern, $comment) ) return false;
     1576        if ( preg_match($pattern, $user_ip) ) return false;
     1577    }
     1578return true;
     1579}
     1580
    15671581?>
Note: See TracChangeset for help on using the changeset viewer.