Changeset 1603
- Timestamp:
- 09/05/2004 01:50:39 AM (22 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
wp-comments-post.php (modified) (4 diffs)
-
wp-includes/functions.php (modified) (1 diff)
-
wp-trackback.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-comments-post.php
r1405 r1603 16 16 $_POST = add_magic_quotes($_POST); 17 17 $_COOKIE = add_magic_quotes($_COOKIE); 18 $_SERVER = add_magic_quotes($_SERVER); 18 19 } 19 20 … … 28 29 if (strlen($url) < 7) 29 30 $url = ''; 31 32 $user_agent = $_SERVER['HTTP_USER_AGENT']; 30 33 31 34 $comment = trim($_POST['comment']); … … 63 66 // If we've made it this far, let's post. 64 67 65 if( check_comment($author, $email, $url, $comment, $user_ip)) {68 if( check_comment($author, $email, $url, $comment, $user_ip, $user_agent) ) { 66 69 $approved = 1; 67 70 } else { … … 70 73 71 74 $wpdb->query("INSERT INTO $wpdb->comments 72 (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_date_gmt, comment_content, comment_approved )75 (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_date_gmt, comment_content, comment_approved, comment_agent) 73 76 VALUES 74 ('$comment_post_ID', '$author', '$email', '$url', '$user_ip', '$now', '$now_gmt', '$comment', '$approved' )77 ('$comment_post_ID', '$author', '$email', '$url', '$user_ip', '$now', '$now_gmt', '$comment', '$approved', '$user_agent') 75 78 "); 76 79 -
trunk/wp-includes/functions.php
r1601 r1603 1494 1494 if ( preg_match($pattern, $comment) ) return false; 1495 1495 if ( preg_match($pattern, $user_ip) ) return false; 1496 if ( preg_match($pattern, $useg_agent) ) return false; 1496 1497 } 1497 1498 -
trunk/wp-trackback.php
r1599 r1603 55 55 $now_gmt = current_time('mysql', 1); 56 56 57 $user_agent = addslashes($_SERVER['HTTP_USER_AGENT']); 58 57 59 $comment = convert_chars($comment); 58 60 $comment = format_to_post($comment); … … 67 69 $moderation_notify = get_settings('moderation_notify'); 68 70 69 if(check_comment($author, $email, $url, $comment, $user_ip )) {71 if(check_comment($author, $email, $url, $comment, $user_ip, $user_agent)) { 70 72 $approved = 1; 71 73 } else { … … 74 76 75 77 $result = $wpdb->query("INSERT INTO $wpdb->comments 76 (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_date_gmt, comment_content, comment_approved )78 (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_date_gmt, comment_content, comment_approved, comment_agent) 77 79 VALUES 78 ('$comment_post_ID', '$author', '$email', '$tb_url', '$user_ip', '$now', '$now_gmt', '$comment', '$approved' )80 ('$comment_post_ID', '$author', '$email', '$tb_url', '$user_ip', '$now', '$now_gmt', '$comment', '$approved', '$user_agent') 79 81 "); 80 82
Note: See TracChangeset
for help on using the changeset viewer.