forked from trhoppe/roadraceautox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblog_callback.php
100 lines (82 loc) · 3.83 KB
/
blog_callback.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
/*======================================================================*\
|| #################################################################### ||
|| # vBulletin Blog 4.2.0 Patch Level 3 - Licence Number VBFBED0615
|| # ---------------------------------------------------------------- # ||
|| # Copyright ©2000-2012 vBulletin Solutions Inc. All Rights Reserved. ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('VB_PRODUCT', 'vbblog');
define('THIS_SCRIPT', 'blog_callback');
define('VBBLOG_SCRIPT', true);
define('SKIP_SESSIONCREATE', 1);
define('VB_AREA', 'BlogCallback');
define('CWD', (($getcwd = getcwd()) ? $getcwd : '.'));
define('NOZIP', 1);
define('NOHEADER', 1);
define('NOCOOKIES', 1);
// #################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();
// get special data templates from the datastore
$specialtemplates = array('blogcategorycache');
// pre-cache templates used by all actions
$globaltemplates = array();
// pre-cache templates used by specific actions
$actiontemplates = array();
// ######################### REQUIRE BACK-END ############################
require_once(CWD . '/includes/init.php');
require_once(DIR . '/includes/blog_functions.php');
require_once(DIR . '/includes/class_trackback.php');
require_once(DIR . '/includes/class_bootstrap.php');
define('VB_AREA', 'Forum');
$bootstrap = new vB_Bootstrap_Forum();
$bootstrap->datastore_entries = $specialtemplates;
$bootstrap->cache_templates = vB_Bootstrap::fetch_required_template_list(array(), array());
$bootstrap->bootstrap();
$vbulletin->input->clean_array_gpc('p', array(
'url' => TYPE_STR,
));
$vbulletin->input->clean_array_gpc('r', array(
'blogid' => TYPE_UINT,
));
// Came to the url directly
if ($vbulletin->GPC['blogid'])
{
if ($vbulletin->options['vbblog_pingback'])
{
$pingbackurl = fetch_seo_url('blogcallback|bburl', array());
header("X-Pingback: $pingbackurl");
}
//we don't have the title available here, but it isn't that critical for a buried redirect
exec_header_redirect(fetch_seo_url('entry|js|nosession', array('blogid' => $vbulletin->GPC['blogid'])));
}
($hook = vBulletinHook::fetch_hook('blog_callback_start')) ? eval($hook) : false;
$trackback = new vB_Trackback_Server($vbulletin);
if ($trackback->parse_blogid(SCRIPTPATH, $vbulletin->GPC['url']) AND $vbulletin->options['vbblog_trackback'])
{
$trackback->send_xml_response();
}
else if (stristr($_SERVER['CONTENT_TYPE'], 'text/xml') === false OR $_SERVER['REQUEST_METHOD'] != 'POST' OR empty($GLOBALS['HTTP_RAW_POST_DATA']) OR !$vbulletin->options['vbblog_pingback'])
{ // Not an XML doc or was sent via GET so do nothing..
exec_header_redirect(fetch_seo_url('forumhome', array()));
}
require_once(DIR . '/includes/class_xmlrpc_pingback.php');
// Pingback Server Instance
$xmlrpc_server = new vB_XMLRPC_Server_Pingback($vbulletin);
$xmlrpc_server->parse_xml($GLOBALS['HTTP_RAW_POST_DATA']);
$xmlrpc_server->parse_xmlrpc();
$xmlrpc_server->send_xml_response();
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 16:29, Sun Dec 9th 2012
|| # SVN: $Revision: 40911 $
|| ####################################################################
\*======================================================================*/
?>