Index: wp-trackback.php
===================================================================
--- wp-trackback.php	(revision 11983)
+++ wp-trackback.php	(working copy)
@@ -34,30 +34,25 @@
 }
 
 // trackback is done by a POST
-$request_array = 'HTTP_POST_VARS';
-
-if ( !$_GET['tb_id'] ) {
+if ( !isset($_GET['tb_id']) || !$_GET['tb_id'] ){
 	$tb_id = explode('/', $_SERVER['REQUEST_URI']);
 	$tb_id = intval( $tb_id[ count($tb_id) - 1 ] );
 }
 
-$tb_url  = $_POST['url'];
-$charset = $_POST['charset'];
+$tb_url  = isset($_POST['url']) ? $_POST['url'] : '';
+$charset = isset($_POST['charset']) ? strtoupper( trim($_POST['charset']) ) : 'ASCII, UTF-8, ISO-8859-1, JIS, EUC-JP, SJIS';
 
-// These three are stripslashed here so that they can be properly escaped after mb_convert_encoding()
-$title     = stripslashes($_POST['title']);
-$excerpt   = stripslashes($_POST['excerpt']);
-$blog_name = stripslashes($_POST['blog_name']);
-
-if ($charset)
-	$charset = strtoupper( trim($charset) );
-else
-	$charset = 'ASCII, UTF-8, ISO-8859-1, JIS, EUC-JP, SJIS';
-
 // No valid uses for UTF-7
 if ( false !== strpos($charset, 'UTF-7') )
 	die;
 
+// These three are stripslashed here so that they can be properly escaped after mb_convert_encoding()
+$title     = isset($_POST['title']) ? stripslashes($_POST['title']) : '';
+$excerpt   = isset($_POST['excerpt']) ? stripslashes($_POST['excerpt']) : '';
+$blog_name = isset($_POST['blog_name']) ? stripslashes($_POST['blog_name']) : '';
+
+
+
 if ( function_exists('mb_convert_encoding') ) { // For international trackbacks
 	$title     = mb_convert_encoding($title, get_option('blog_charset'), $charset);
 	$excerpt   = mb_convert_encoding($excerpt, get_option('blog_charset'), $charset);
@@ -72,7 +67,7 @@
 if ( is_single() || is_page() )
 	$tb_id = $posts[0]->ID;
 
-if ( !intval( $tb_id ) )
+if ( !isset($tb_id) || !intval( $tb_id ) )
 	trackback_response(1, 'I really need an ID for this to work.');
 
 if (empty($title) && empty($tb_url) && empty($blog_name)) {
@@ -82,15 +77,14 @@
 }
 
 if ( !empty($tb_url) && !empty($title) ) {
-	header('Content-Type: text/xml; charset=' . get_option('blog_charset') );
 
 	if ( !pings_open($tb_id) )
 		trackback_response(1, 'Sorry, trackbacks are closed for this item.');
-
+	
 	$title =  wp_html_excerpt( $title, 250 ).'...';
 	$excerpt = wp_html_excerpt( $excerpt, 252 ).'...';
 
-	$comment_post_ID = (int) $tb_id;
+	$comment_post_ID = $tb_id;
 	$comment_author = $blog_name;
 	$comment_author_email = '';
 	$comment_author_url = $tb_url;
