X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=trackback.php;h=90a22e4bd552822d8c5d2ff1f5e418dffd6e9d2f;hb=47479fe6cf8217dfa70df2d9ce43d241b176aa16;hp=50a33411424c9a80579e0765451f5c71ec618865;hpb=f88c771756c580442fe7ca2f84bcbb8067b77f57;p=lhc%2Fweb%2Fwiklou.git
diff --git a/trackback.php b/trackback.php
index 50a3341142..90a22e4bd5 100644
--- a/trackback.php
+++ b/trackback.php
@@ -4,15 +4,14 @@
* @addtogroup SpecialPage
*/
require_once( './includes/WebStart.php' );
-
-require_once('DatabaseFunctions.php');
+require_once( './includes/DatabaseFunctions.php' );
/**
*
*/
function XMLsuccess() {
- echo "
-
+ header("Content-Type: application/xml; charset=utf-8");
+ echo "
0
@@ -22,8 +21,8 @@ function XMLsuccess() {
function XMLerror($err = "Invalid request.") {
header("HTTP/1.0 400 Bad Request");
- echo "
-
+ header("Content-Type: application/xml; charset=utf-8");
+ echo "
1
Invalid request: $err
@@ -36,17 +35,16 @@ if (!$wgUseTrackbacks)
XMLerror("Trackbacks are disabled.");
if ( !isset($_POST['url'])
- || !isset($_POST['blog_name'])
|| !isset($_REQUEST['article']))
XMLerror("Required field not specified");
$dbw = wfGetDB(DB_MASTER);
-$tbtitle = $_POST['title'];
-$tbex = $_POST['excerpt'];
-$tburl = $_POST['url'];
-$tbname = $_POST['blog_name'];
-$tbarticle = $_REQUEST['article'];
+$tbtitle = strval( @$_POST['title'] );
+$tbex = strval( @$_POST['excerpt'] );
+$tburl = strval( $_POST['url'] );
+$tbname = strval( @$_POST['blog_name'] );
+$tbarticle = strval( $_REQUEST['article'] );
$title = Title::newFromText($tbarticle);
if (!isset($title) || !$title->exists())
@@ -59,7 +57,8 @@ $dbw->insert('trackbacks', array(
'tb_ex' => $tbex,
'tb_name' => $tbname
));
+$dbw->commit();
XMLsuccess();
-exit;
+
?>