aboutsummaryrefslogtreecommitdiffstats
path: root/mod/dfrn_notify.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-10-12 20:29:04 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-10-12 20:29:04 -0700
commit033935c19406c8468ed75fdd15a3a532f4e25319 (patch)
treead73289f296bf14d6cc6977e41af88fd2f1909d6 /mod/dfrn_notify.php
parent3c440f70c66953735d01841453fa6a7ed244ef1c (diff)
downloadvolse-hubzilla-033935c19406c8468ed75fdd15a3a532f4e25319.tar.gz
volse-hubzilla-033935c19406c8468ed75fdd15a3a532f4e25319.tar.bz2
volse-hubzilla-033935c19406c8468ed75fdd15a3a532f4e25319.zip
cleanup to ensure protocol version is passed properly. We will need it if/when any incompatible protocol changes are introduced.
Diffstat (limited to 'mod/dfrn_notify.php')
-rw-r--r--mod/dfrn_notify.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php
index 4a23da505..5779b68d2 100644
--- a/mod/dfrn_notify.php
+++ b/mod/dfrn_notify.php
@@ -7,6 +7,7 @@ require_once('include/items.php');
function dfrn_notify_post(&$a) {
$dfrn_id = notags(trim($_POST['dfrn_id']));
+ $dfrn_version = (float) $_POST['dfrn_version'];
$challenge = notags(trim($_POST['challenge']));
$data = $_POST['data'];
@@ -374,6 +375,8 @@ function dfrn_notify_content(&$a) {
// If this is a duplex communication, ours will be the opposite.
$dfrn_id = notags(trim($_GET['dfrn_id']));
+ $dfrn_version = (float) $_GET['dfrn_version'];
+
$direction = (-1);
if(strpos($dfrn_id,':') == 1) {
@@ -435,7 +438,16 @@ function dfrn_notify_content(&$a) {
$challenge = bin2hex($challenge);
$encrypted_id = bin2hex($encrypted_id);
- echo '<?xml version="1.0" encoding="UTF-8"?><dfrn_notify><status>' . $status . '</status><dfrn_version>2.0</dfrn_version><dfrn_id>' . $encrypted_id . '</dfrn_id><challenge>' . $challenge . '</challenge></dfrn_notify>' . "\r\n" ;
+ header("Content-type: text/xml");
+
+ echo '<?xml version="1.0" encoding="UTF-8"?>' . "\r\n"
+ . '<dfrn_notify>' . "\r\n"
+ . "\t" . '<status>' . $status . '</status>' . "\r\n"
+ . "\t" . '<dfrn_version>' . DFRN_PROTOCOL_VERSION . '</dfrn_version>' . "\r\n"
+ . "\t" . '<dfrn_id>' . $encrypted_id . '</dfrn_id>' . "\r\n"
+ . "\t" . '<challenge>' . $challenge . '</challenge>' . "\r\n"
+ . '</dfrn_notify>' . "\r\n" ;
+
killme();
}