Changeset 1794 for trunk/wp-includes/functions-post.php
- Timestamp:
- 10/14/2004 07:26:41 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions-post.php
r1778 r1794 361 361 $comment_author = strip_tags($comment_author); 362 362 $comment_author = htmlspecialchars($comment_author); 363 $comment_author = $wpdb->escape($comment_author);364 363 365 364 $comment_author_email = preg_replace('/[^a-z+_.@-]/i', '', $comment_author_email); … … 367 366 $comment_author_url = strip_tags($comment_author_url); 368 367 $comment_author_url = htmlspecialchars($comment_author_url); 369 $comment_author_url = $wpdb->escape($comment_author_url);370 368 371 369 $comment_content = apply_filters('comment_content_presave', $comment_content); 372 $comment_content = $wpdb->escape($comment_content);373 370 374 371 $user_ip = addslashes($_SERVER['REMOTE_ADDR']); … … 407 404 } 408 405 406 function do_trackbacks($post_id) { 407 global $wpdb; 408 409 $post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID = $post_id"); 410 $to_ping = get_to_ping($post_id); 411 $pinged = get_pung($post_id); 412 $content = strip_tags($post->post_content); 413 $excerpt = strip_tags($post->post_excerpt); 414 $post_title = strip_tags($post->post_title); 415 416 if ( $excerpt ) 417 $excerpt = substr($excerpt, 0, 252) . '...'; 418 else 419 $excerpt = substr($content, 0, 252) . '...'; 420 421 if ($to_ping) : foreach ($to_ping as $tb_ping) : 422 $tb_ping = trim($tb_ping); 423 if ( !in_array($tb_ping, $pinged) ) 424 trackback($tb_ping, $post_title, $excerpt, $post_id); 425 endforeach; endif; 426 } 427 428 function get_pung($post_id) { // Get URIs already pung for a post 429 global $wpdb; 430 $pung = $wpdb->get_var("SELECT pinged FROM $wpdb->posts WHERE ID = $post_id"); 431 $pung = trim($pung); 432 $pung = preg_split('/\s/', $pung); 433 return $pung; 434 } 435 436 function get_to_ping($post_id) { // Get any URIs in the todo list 437 global $wpdb; 438 $to_ping = $wpdb->get_var("SELECT to_ping FROM $wpdb->posts WHERE ID = $post_id"); 439 $to_ping = trim($to_ping); 440 $to_ping = preg_split('/\s/', $to_ping); 441 return $to_ping; 442 } 443 444 function add_ping($post_id, $uri) { // Add a URI to those already pung 445 global $wpdb; 446 $pung = $wpdb->get_var("SELECT pinged FROM $wpdb->posts WHERE ID = $post_id"); 447 $pung = trim($pung); 448 $pung = preg_split('/\s/', $pung); 449 $pung[] = $uri; 450 $new = implode("\n", $pung); 451 return $wpdb->query("UPDATE $wpdb->posts SET pinged = '$new' WHERE ID = $post_id"); 452 } 453 409 454 ?>
Note: See TracChangeset
for help on using the changeset viewer.