Changeset 984
- Timestamp:
- 03/21/2004 08:31:33 AM (21 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/options-discussion.php
r970 r984 114 114 </li> 115 115 </ul> 116 <p>When a comment contains any of these words in its content, name, URI, or email, hold it in the moderation queue: (Seperate multiple words with new lines.)</p>116 <p>When a comment contains any of these words in its content, name, URI, email, or IP, hold it in the moderation queue: (Seperate multiple words with new lines.) <a href="http://wiki.wordpress.org/index.php/SpamWords">Common spam words</a>.</p> 117 117 <p> 118 118 <textarea name="moderation_keys" cols="60" rows="4" id="moderation_keys" style="width: 98%;"><?php echo get_settings('moderation_keys'); ?></textarea> -
trunk/wp-comments-post.php
r956 r984 76 76 77 77 if ($ok) { // if there was no comment from this IP in the last 10 seconds 78 $comment_moderation = get_settings('comment_moderation');79 78 $moderation_notify = get_settings('moderation_notify'); 80 79 $comments_notify = get_settings('comments_notify'); 81 80 82 // o42: this place could be the hook for further comment spam checking 83 // $approved should be set according the final approval status 84 // of the new comment 85 if ('manual' == $comment_moderation) { 81 if(check_comment($author, $email, $url, $comment, $user_ip)) { 82 $approved = 1; 83 } else { 86 84 $approved = 0; 87 } else if ('auto' == $comment_moderation) {88 $approved = 0;89 } else { // none90 $approved = 1;91 85 } 86 92 87 $wpdb->query("INSERT INTO $tablecomments 93 (comment_ ID, comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_content, comment_approved)88 (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_content, comment_approved) 94 89 VALUES 95 (' 0', '$comment_post_ID', '$author', '$email', '$url', '$user_ip', '$now', '$comment', '$approved')90 ('$comment_post_ID', '$author', '$email', '$url', '$user_ip', '$now', '$comment', '$approved') 96 91 "); 97 92 -
trunk/wp-comments.php
r945 r984 72 72 </p> 73 73 74 <?php75 if ('none' != get_settings("comment_moderation")) {76 ?>77 <p>78 <strong>Please note:</strong> Comment moderation is currently enabled so there may be a delay between when you post your comment and when it shows up. Patience is a virtue; there’s no need to resubmit your comment.79 </p>80 <?php81 } // comment_moderation != 'none'82 ?>83 84 74 <p> 85 75 <input name="submit" type="submit" tabindex="5" value="Say it!" /> -
trunk/wp-includes/functions.php
r982 r984 1565 1565 } 1566 1566 1567 function 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 } 1578 return true; 1579 } 1580 1567 1581 ?> -
trunk/wp-trackback.php
r957 r984 67 67 $moderation_notify = get_settings('moderation_notify'); 68 68 69 if ('manual' == $comment_moderation) { 69 if(check_comment($author, $email, $url, $comment, $user_ip)) { 70 $approved = 1; 71 } else { 70 72 $approved = 0; 71 } else if ('auto' == $comment_moderation) {72 $approved = 0;73 } else { // none74 $approved = 1;75 73 } 76 74
Note: See TracChangeset
for help on using the changeset viewer.