aboutsummaryrefslogtreecommitdiffstats
path: root/mod/pubsub.php
diff options
context:
space:
mode:
authorVasudev Kamath <kamathvasudev@gmail.com>2012-06-11 20:47:11 +0530
committerVasudev Kamath <kamathvasudev@gmail.com>2012-06-11 20:47:11 +0530
commit11974b4d948ae5d9b9fb53970838463bd88bb9f6 (patch)
tree426724e218a2fcaf3a1a2eedf6ffa591299755ee /mod/pubsub.php
parent079fdecff1f4daa534045f4bd857e6ae6324474d (diff)
parentafa88154114d5632cb13e7c3f56143cccdfd7daa (diff)
downloadvolse-hubzilla-11974b4d948ae5d9b9fb53970838463bd88bb9f6.tar.gz
volse-hubzilla-11974b4d948ae5d9b9fb53970838463bd88bb9f6.tar.bz2
volse-hubzilla-11974b4d948ae5d9b9fb53970838463bd88bb9f6.zip
Merge branch 'master' of git://github.com/friendica/friendica
Diffstat (limited to 'mod/pubsub.php')
-rw-r--r--mod/pubsub.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/mod/pubsub.php b/mod/pubsub.php
index 93d50ef90..64fbda289 100644
--- a/mod/pubsub.php
+++ b/mod/pubsub.php
@@ -47,22 +47,30 @@ function pubsub_init(&$a) {
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `account_expired` = 0 LIMIT 1",
dbesc($nick)
);
- if(! count($r))
+ if(! count($r)) {
+ logger('pubsub: local account not found: ' . $nick);
hub_return(false, '');
+ }
$owner = $r[0];
$sql_extra = ((strlen($hub_verify)) ? sprintf(" AND `hub-verify` = '%s' ", dbesc($hub_verify)) : '');
- $r = q("SELECT * FROM `contact` WHERE `poll` = '%s' AND `id` = %d AND `uid` = %d
+ $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d
AND `blocked` = 0 AND `pending` = 0 $sql_extra LIMIT 1",
- dbesc($hub_topic),
intval($contact_id),
intval($owner['uid'])
);
- if(! count($r))
+ if(! count($r)) {
+ logger('pubsub: contact not found.');
hub_return(false, '');
+ }
+
+ if(! link_compare($hub_topic,$r[0]['poll'])) {
+ logger('pubsub: hub topic ' . $hub_topic . ' != ' . $r[0]['poll']);
+ // should abort but let's humour them.
+ }
$contact = $r[0];