Changeset 147444
- Timestamp:
- 08/20/2009 12:50:39 PM (17 years ago)
- File:
-
- 1 edited
-
spamtask/trunk/spamtask.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
spamtask/trunk/spamtask.php
r146712 r147444 5 5 Description: Protects your blog from comment spam, using advanced spam filtering methods. All spam robots are caught effectively. 6 6 Author: Jenruno 7 Version: 1.3.4. 17 Version: 1.3.4.2 8 8 Author URI: http://www.jenruno.com/ 9 9 */ … … 18 18 19 19 function SpamTask_MakeCall($host, $POST) { 20 $q = 'HTTP_REFERER='.urlencode($_SERVER['HTTP_HOST']).'&REMOTE_ADDR='.urlencode($_SERVER['REMOTE_ADDR']).'&SpamTask_version=1-3-4- 1';20 $q = 'HTTP_REFERER='.urlencode($_SERVER['HTTP_HOST']).'&REMOTE_ADDR='.urlencode($_SERVER['REMOTE_ADDR']).'&SpamTask_version=1-3-4-2'; 21 21 if($POST) { foreach($POST AS $p => $v) { $q .= '&'.urlencode($p).'='.urlencode($v); } } 22 22 … … 184 184 $_POST['author'] = $current_user->display_name; 185 185 $_POST['email'] = $current_user->user_email; 186 } 187 188 $_POST['wp_blog'] = get_bloginfo('wpurl'); 189 $_POST['wp_userlevel'] = $user_level; 190 $result = SpamTask_MakeCall('www.spamtask.com', $_POST); 191 192 if($result AND !strpos($result, 'errorCode">2')) { 193 SpamTask_SaveStatistics($result); 194 $comment['comment_approved'] = 'spam'; 195 ob_start(); 196 echo $result; 197 if(!strpos($result, 'errorCode')) { 198 add_filter('comment_post_redirect', create_function('$a', 'ob_end_flush(); exit();'), 10, 2); 199 return $comment; 200 } else { exit(); } 201 } else { 202 SpamTask_SaveStatistics($result); 203 $r = $wpdb->get_row("SELECT comment_ID, comment_approved, comment_post_ID FROM ".$wpdb->comments." WHERE comment_approved = 'spam' ORDER BY comment_date DESC LIMIT 1"); 204 if(get_option('comment_moderation') == 1 AND $user_level < 9) { 205 $wpdb->query("UPDATE ".$wpdb->comments." SET comment_approved = '0' WHERE comment_ID = '".$r->comment_ID."'"); 186 if(strpos(' '.$_SERVER['REQUEST_URI'], 'wp-admin/admin-ajax.php')) { $in_wp_admin = TRUE; } 187 else { $in_wp_admin = FALSE; } 188 } 189 if(!$in_wp_admin) { 190 $_POST['wp_blog'] = get_bloginfo('wpurl'); 191 $_POST['wp_userlevel'] = $user_level; 192 $result = SpamTask_MakeCall('www.spamtask.com', $_POST); 193 194 if($result AND !strpos($result, 'errorCode">2')) { 195 SpamTask_SaveStatistics($result); 196 $comment['comment_approved'] = 'spam'; 197 ob_start(); 198 echo $result; 199 if(!strpos($result, 'errorCode')) { 200 add_filter('comment_post_redirect', create_function('$a', 'ob_end_flush(); exit();'), 10, 2); 201 return $comment; 202 } else { exit(); } 206 203 } else { 207 $wpdb->query("UPDATE ".$wpdb->comments." SET comment_approved = '1' WHERE comment_ID = '".$r->comment_ID."'"); 208 $wpdb->query("UPDATE ".$wpdb->posts." SET comment_count = comment_count+1 WHERE ID = '".$r->comment_post_ID."'"); 209 } 210 if($user_level < 9) { wp_notify_moderator($r->comment_ID); } 211 $location = get_permalink($r->comment_post_ID); 212 wp_redirect($location); exit(); 213 } 204 SpamTask_SaveStatistics($result); 205 $r = $wpdb->get_row("SELECT comment_ID, comment_approved, comment_post_ID FROM ".$wpdb->comments." WHERE comment_approved = 'spam' ORDER BY comment_date DESC LIMIT 1"); 206 if(get_option('comment_moderation') == 1 AND $user_level < 9) { 207 $wpdb->query("UPDATE ".$wpdb->comments." SET comment_approved = '0' WHERE comment_ID = '".$r->comment_ID."'"); 208 } else { 209 $wpdb->query("UPDATE ".$wpdb->comments." SET comment_approved = '1' WHERE comment_ID = '".$r->comment_ID."'"); 210 $wpdb->query("UPDATE ".$wpdb->posts." SET comment_count = comment_count+1 WHERE ID = '".$r->comment_post_ID."'"); 211 } 212 if($user_level < 9) { wp_notify_moderator($r->comment_ID); } 213 $location = get_permalink($r->comment_post_ID); 214 wp_redirect($location); exit(); 215 } 216 } else { return $comment; } 214 217 } 215 218
Note: See TracChangeset
for help on using the changeset viewer.