3 * Provide functions to handle article trackbacks.
5 * @subpackage SpecialPage
9 define('MEDIAWIKI', true);
10 if ( isset( $_REQUEST['GLOBALS'] ) ) {
11 echo '<a href="http://www.hardened-php.net/index.76.html">$GLOBALS overwrite vulnerability</a>';
15 require_once('./includes/Defines.php');
17 if (!file_exists('LocalSettings.php'))
20 require_once('./LocalSettings.php');
21 require_once('includes/Setup.php');
23 require_once('DatabaseFunctions.php');
28 function XMLsuccess() {
30 <?xml version=\"1.0\" encoding=\"utf-8\"?>
38 function XMLerror($err = "Invalid request.") {
39 header("HTTP/1.0 400 Bad Request");
41 <?xml version=\"1.0\" encoding=\"utf-8\"?>
44 <message>Invalid request: $err</message>
50 if (!$wgUseTrackbacks)
51 XMLerror("Trackbacks are disabled.");
53 if ( !isset($_POST['url'])
54 ||
!isset($_POST['blog_name'])
55 ||
!isset($_REQUEST['article']))
56 XMLerror("Required field not specified");
58 $dbw =& wfGetDB(DB_MASTER
);
60 $tbtitle = $_POST['title'];
61 $tbex = $_POST['excerpt'];
62 $tburl = $_POST['url'];
63 $tbname = $_POST['blog_name'];
64 $tbarticle = $_REQUEST['article'];
66 $title = Title
::newFromText($tbarticle);
67 if (!$title->exists())
68 XMLerror("Specified article does not exist.");
70 $dbw->insert('trackbacks', array(
71 'tb_page' => $title->getArticleID(),
72 'tb_title' => $tbtitle,