aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/notifier.php17
-rw-r--r--include/poller.php21
2 files changed, 33 insertions, 5 deletions
diff --git a/include/notifier.php b/include/notifier.php
index a703dbee9..cc2846735 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -278,10 +278,19 @@
if((! strlen($rr['dfrn-id'])) && (! $rr['duplex']))
continue;
- $idtosend = (($rr['dfrn-id']) ? $rr['dfrn-id'] : $rr['issued-id']);
+
+ $idtosend = $orig_id = (($rr['dfrn-id']) ? $rr['dfrn-id'] : $rr['issued-id']);
+
+ if($rr['duplex'] && $rr['dfrn-id'])
+ $idtosend = '0:' . $orig_id;
+ if($rr['duplex'] && $rr['issued-id'])
+ $idtosend = '1:' . $orig_id;
$url = $rr['notify'] . '?dfrn_id=' . $idtosend;
+ if($debugging)
+ echo "URL: $url";
+
$xml = fetch_url($url);
if($debugging)
@@ -312,7 +321,11 @@
}
$final_dfrn_id = substr($final_dfrn_id, 0, strpos($final_dfrn_id, '.'));
- if($final_dfrn_id != $idtosend) {
+
+ if(strpos($final_dfrn_id,':') == 1)
+ $final_dfrn_id = substr($final_dfrn_id,2);
+
+ if($final_dfrn_id != $orig_id) {
// did not decode properly - cannot trust this site
continue;
}
diff --git a/include/poller.php b/include/poller.php
index dc2710ef0..c4d697e24 100644
--- a/include/poller.php
+++ b/include/poller.php
@@ -79,10 +79,16 @@
? datetime_convert('UTC','UTC','now - 30 days','Y-m-d\TH:i:s\Z')
: datetime_convert('UTC','UTC',$contact['last-update'],'Y-m-d\TH:i:s\Z'));
- $idtosend = (($contact['dfrn-id']) ? $contact['dfrn-id'] : $contact['issued-id']);
- $url = $contact['poll'] . '?dfrn_id=' . $idtosend . '&type=data&last_update=' . $last_update ;
+ $idtosend = $orig_id = (($contact['dfrn-id']) ? $contact['dfrn-id'] : $contact['issued-id']);
+
+ if(intval($contact['duplex']) && $contact['dfrn-id'])
+ $idtosend = '0:' . $orig_id;
+ if(intval($contact['duplex']) && $contact['issued-id'])
+ $idtosend = '1:' . $orig_id;
+
+ $url = $contact['poll'] . '?dfrn_id=' . $idtosend . '&type=data&last_update=' . $last_update ;
$xml = fetch_url($url);
if($debugging) {
@@ -93,6 +99,8 @@
if(! $xml)
continue;
+
+
$res = simplexml_load_string($xml);
if(intval($res->status) == 1)
@@ -122,13 +130,20 @@
}
$final_dfrn_id = substr($final_dfrn_id, 0, strpos($final_dfrn_id, '.'));
- if($final_dfrn_id != $idtosend) {
+
+ if(strpos($final_dfrn_id,':') == 1)
+ $final_dfrn_id = substr($final_dfrn_id,2);
+
+ if($final_dfrn_id != $orig_id) {
+
// did not decode properly - cannot trust this site
continue;
}
$postvars['dfrn_id'] = $idtosend;
+
+
$xml = post_url($contact['poll'],$postvars);
if($debugging) {