Changeset 4495 for trunk/wp-includes/comment.php
- Timestamp:
- 11/19/2006 07:56:05 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/comment.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/comment.php
r4299 r4495 19 19 if (empty($word)) { continue; } 20 20 21 // Do some escaping magic so that '#' chars in the 21 // Do some escaping magic so that '#' chars in the 22 22 // spam words don't break things: 23 23 $word = preg_quote($word, '#'); 24 24 25 $pattern = "#$word#i"; 25 $pattern = "#$word#i"; 26 26 if ( preg_match($pattern, $author) ) return false; 27 27 if ( preg_match($pattern, $email) ) return false; … … 104 104 $query = "SELECT * FROM $wpdb->comments WHERE comment_ID = '$comment_ID'"; 105 105 if (false == $include_unapproved) { 106 $query .= " AND comment_approved = '1'";107 } 108 $myrow = $wpdb->get_row($query, ARRAY_A);106 $query .= " AND comment_approved = '1'"; 107 } 108 $myrow = $wpdb->get_row($query, ARRAY_A); 109 109 } else { 110 110 $myrow['comment_ID'] = $postc->comment_ID; … … 158 158 $comment_author_email = apply_filters('pre_comment_author_email', $_COOKIE['comment_author_email_'.COOKIEHASH]); 159 159 $comment_author_email = stripslashes($comment_author_email); 160 $comment_author_email = wp_specialchars($comment_author_email, true); 160 $comment_author_email = wp_specialchars($comment_author_email, true); 161 161 $_COOKIE['comment_author_email_'.COOKIEHASH] = $comment_author_email; 162 162 } … … 244 244 if ( empty($word) ) { continue; } 245 245 246 // Do some escaping magic so that '#' chars in the 246 // Do some escaping magic so that '#' chars in the 247 247 // spam words don't break things: 248 248 $word = preg_quote($word, '#'); 249 249 250 $pattern = "#$word#i"; 250 $pattern = "#$word#i"; 251 251 if ( preg_match($pattern, $author ) ) return true; 252 252 if ( preg_match($pattern, $email ) ) return true; … … 329 329 $user_id = 0; 330 330 331 $result = $wpdb->query("INSERT INTO $wpdb->comments 331 $result = $wpdb->query("INSERT INTO $wpdb->comments 332 332 (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, comment_type, comment_parent, user_id) 333 VALUES 333 VALUES 334 334 ('$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', '$comment_type', '$comment_parent', '$user_id') 335 335 "); … … 398 398 399 399 function wp_set_comment_status($comment_id, $comment_status) { 400 global $wpdb;401 402 switch($comment_status) {400 global $wpdb; 401 402 switch($comment_status) { 403 403 case 'hold': 404 404 $query = "UPDATE $wpdb->comments SET comment_approved='0' WHERE comment_ID='$comment_id' LIMIT 1"; … … 407 407 $query = "UPDATE $wpdb->comments SET comment_approved='1' WHERE comment_ID='$comment_id' LIMIT 1"; 408 408 break; 409 case 'spam':410 $query = "UPDATE $wpdb->comments SET comment_approved='spam' WHERE comment_ID='$comment_id' LIMIT 1";411 break;409 case 'spam': 410 $query = "UPDATE $wpdb->comments SET comment_approved='spam' WHERE comment_ID='$comment_id' LIMIT 1"; 411 break; 412 412 case 'delete': 413 413 return wp_delete_comment($comment_id); … … 415 415 default: 416 416 return false; 417 }418 419 if ($wpdb->query($query)) {417 } 418 419 if ($wpdb->query($query)) { 420 420 do_action('wp_set_comment_status', $comment_id, $comment_status); 421 421 … … 426 426 $wpdb->query( "UPDATE $wpdb->posts SET comment_count = '$c->c' WHERE ID = '$comment_post_ID'" ); 427 427 return true; 428 } else {428 } else { 429 429 return false; 430 }430 } 431 431 } 432 432 … … 583 583 pingback($ping->post_content, $ping->ID); 584 584 } 585 585 586 586 // Do Enclosures 587 587 while ($enclosure = $wpdb->get_row("SELECT * FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_encloseme' LIMIT 1")) { … … 706 706 707 707 if ($pingback_server_url) { 708 @ set_time_limit( 60 ); 708 @ set_time_limit( 60 ); 709 709 // Now, the RPC call 710 710 debug_fwrite($log, "Page Linked To: $pagelinkedto \n");
Note: See TracChangeset
for help on using the changeset viewer.