Show
Ignore:
Timestamp:
06/13/08 17:21:00 (6 months ago)
Author:
donncha
Message:

WP Merge with revision 8075

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-trackback.php

    r1218 r1328  
    11<?php 
     2/** 
     3 * Handle Trackbacks and Pingbacks sent to WordPress 
     4 * 
     5 * @package WordPress 
     6 */ 
    27 
    38if (empty($wp)) { 
    4         require_once('./wp-config.php'); 
     9        require_once('./wp-load.php'); 
    510        wp('tb=1'); 
    611} 
    712 
     13/** 
     14 * trackback_response() - Respond with error or success XML message 
     15 * 
     16 * @param int|bool $error Whether there was an error or not 
     17 * @param string $error_message Error message if an error occurred 
     18 */ 
    819function trackback_response($error = 0, $error_message = '') { 
    920        header('Content-Type: text/xml; charset=' . get_option('blog_charset') ); 
     
    8798        $comment_type = 'trackback'; 
    8899 
    89         $dupe = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$comment_post_ID' AND comment_author_url = '$comment_author_url'"); 
     100        $dupe = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_author_url = %s", $comment_post_ID, $comment_author_url) ); 
    90101        if ( $dupe ) 
    91102                trackback_response(1, 'We already have a ping from that URL for this post.');