Non-trackback requests to wp-trackback.php now redirect to the post.

git-svn-id: https://develop.svn.wordpress.org/trunk@637 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2003-12-22 03:10:54 +00:00
parent 7d72c03fb8
commit 7c2b2a969f
1 changed files with 14 additions and 16 deletions

View File

@ -1,21 +1,19 @@
<?php
require(dirname(__FILE__) . '/wp-config.php');
if (!empty($HTTP_GET_VARS['tb_id'])) {
// trackback is done by a GET
$tb_id = intval($HTTP_GET_VARS['tb_id']);
$tb_url = $HTTP_GET_VARS['url'];
$title = $HTTP_GET_VARS['title'];
$excerpt = $HTTP_GET_VARS['excerpt'];
$blog_name = $HTTP_GET_VARS['blog_name'];
} elseif (!empty($HTTP_POST_VARS['url'])) {
// trackback is done by a POST
$request_array = 'HTTP_POST_VARS';
$tb_id = explode('/', $HTTP_SERVER_VARS['REQUEST_URI']);
$tb_id = intval($tb_id[count($tb_id)-1]);
$tb_url = $HTTP_POST_VARS['url'];
$title = $HTTP_POST_VARS['title'];
$excerpt = $HTTP_POST_VARS['excerpt'];
$blog_name = $HTTP_POST_VARS['blog_name'];
// trackback is done by a POST
$request_array = 'HTTP_POST_VARS';
$tb_id = explode('/', $HTTP_SERVER_VARS['REQUEST_URI']);
$tb_id = intval($tb_id[count($tb_id)-1]);
$tb_url = $HTTP_POST_VARS['url'];
$title = $HTTP_POST_VARS['title'];
$excerpt = $HTTP_POST_VARS['excerpt'];
$blog_name = $HTTP_POST_VARS['blog_name'];
if (empty($title) && empty($tb_url) && empty($blog_name)) {
// If it doesn't look like a trackback at all...
header('Location: ' . get_permalink($tb_id));
}
if ((strlen(''.$tb_id)) && (empty($HTTP_GET_VARS['__mode'])) && (strlen(''.$tb_url))) {