aboutsummaryrefslogtreecommitdiffstats
path: root/include/channel.php
diff options
context:
space:
mode:
authorZot <mike@macgirvin.com>2019-04-25 11:54:37 +0200
committerMario <mario@mariovavti.com>2019-04-25 11:54:37 +0200
commit3c8f8b76aa35eed1e612cb20537b8648bef3daca (patch)
treeee68e6a3ec60aeedd21fff263e826735fd51f429 /include/channel.php
parentc123fa5422c9c2df741819c4fb9a1b19547866d4 (diff)
downloadvolse-hubzilla-3c8f8b76aa35eed1e612cb20537b8648bef3daca.tar.gz
volse-hubzilla-3c8f8b76aa35eed1e612cb20537b8648bef3daca.tar.bz2
volse-hubzilla-3c8f8b76aa35eed1e612cb20537b8648bef3daca.zip
hubloc confusion in magic auth
Diffstat (limited to 'include/channel.php')
-rw-r--r--include/channel.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/channel.php b/include/channel.php
index 654bbdb05..47a7b5a0e 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -1812,13 +1812,16 @@ function zid_init() {
call_hooks('zid_init', $arr);
if(! local_channel()) {
- $r = q("select * from hubloc where hubloc_addr = '%s' order by hubloc_connected desc limit 1",
+ $r = q("select * from hubloc where hubloc_addr = '%s' order by hubloc_connected desc",
dbesc($tmp_str)
);
if(! $r) {
Master::Summon(array('Gprobe',bin2hex($tmp_str)));
}
- if($r && remote_channel() && remote_channel() === $r[0]['hubloc_hash'])
+ if($r) {
+ $r = zot_record_preferred($r);
+ }
+ if($r && remote_channel() && remote_channel() === $r['hubloc_hash'])
return;
logger('Not authenticated. Invoking reverse magic-auth for ' . $tmp_str);
@@ -1826,8 +1829,8 @@ function zid_init() {
$query = App::$query_string;
$query = str_replace(array('?zid=','&zid='),array('?rzid=','&rzid='),$query);
$dest = '/' . $query;
- if($r && ($r[0]['hubloc_url'] != z_root()) && (! strstr($dest,'/magic')) && (! strstr($dest,'/rmagic'))) {
- goaway($r[0]['hubloc_url'] . '/magic' . '?f=&rev=1&owa=1&bdest=' . bin2hex(z_root() . $dest));
+ if($r && ($r['hubloc_url'] != z_root()) && (! strstr($dest,'/magic')) && (! strstr($dest,'/rmagic'))) {
+ goaway($r['hubloc_url'] . '/magic' . '?f=&rev=1&owa=1&bdest=' . bin2hex(z_root() . $dest));
}
else
logger('No hubloc found.');