let's make this failsafe
This commit is contained in:
parent
9e5f54af60
commit
b25783b9b6
@ -25,14 +25,17 @@ function magic_init(&$a) {
|
|||||||
else {
|
else {
|
||||||
// See if we know anybody at the dest site that will unlock the door for us
|
// See if we know anybody at the dest site that will unlock the door for us
|
||||||
$b = explode('/',$dest);
|
$b = explode('/',$dest);
|
||||||
|
$u = '';
|
||||||
if(count($b) >= 2)
|
if(count($b) >= 2)
|
||||||
$u = $b[0] . '//' . $b[2];
|
$u = $b[0] . '//' . $b[2];
|
||||||
logger('mod_magic: fallback: ' . $b . ' -> ' . $u);
|
logger('mod_magic: fallback: ' . $b . ' -> ' . $u);
|
||||||
|
|
||||||
$x = q("select xchan.xchan_url, hubloc.* from xchan left join hubloc on xchan_hash = hubloc_hash
|
if($u) {
|
||||||
where hubloc_url = '%s' order by hubloc_id desc limit 1",
|
$x = q("select xchan.xchan_url, hubloc.* from xchan left join hubloc on xchan_hash = hubloc_hash
|
||||||
dbesc($u)
|
where hubloc_url = '%s' order by hubloc_id desc limit 1",
|
||||||
);
|
dbesc($u)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user