3 * Provide functions to handle article trackbacks.
4 * @addtogroup SpecialPage
6 require_once( './includes/WebStart.php' );
8 require_once('DatabaseFunctions.php');
13 function XMLsuccess() {
15 <?xml version=\"1.0\" encoding=\"utf-8\"?>
23 function XMLerror($err = "Invalid request.") {
24 header("HTTP/1.0 400 Bad Request");
26 <?xml version=\"1.0\" encoding=\"utf-8\"?>
29 <message>Invalid request: $err</message>
35 if (!$wgUseTrackbacks)
36 XMLerror("Trackbacks are disabled.");
38 if ( !isset($_POST['url'])
39 ||
!isset($_POST['blog_name'])
40 ||
!isset($_REQUEST['article']))
41 XMLerror("Required field not specified");
43 $dbw = wfGetDB(DB_MASTER
);
45 $tbtitle = $_POST['title'];
46 $tbex = $_POST['excerpt'];
47 $tburl = $_POST['url'];
48 $tbname = $_POST['blog_name'];
49 $tbarticle = $_REQUEST['article'];
51 $title = Title
::newFromText($tbarticle);
52 if (!isset($title) ||
!$title->exists())
53 XMLerror("Specified article does not exist.");
55 $dbw->insert('trackbacks', array(
56 'tb_page' => $title->getArticleID(),
57 'tb_title' => $tbtitle,