diff options
author | zotlabs <mike@macgirvin.com> | 2019-04-24 16:21:59 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2019-04-24 16:21:59 -0700 |
commit | c88286556a29974ea6955a6fb683a0ff35705ea5 (patch) | |
tree | f269edece634d13bb567db01ccbfb970fa4903f4 /include/zot.php | |
parent | 831b9d443330cb806871ab06aaa977adafbe661e (diff) | |
download | volse-hubzilla-c88286556a29974ea6955a6fb683a0ff35705ea5.tar.gz volse-hubzilla-c88286556a29974ea6955a6fb683a0ff35705ea5.tar.bz2 volse-hubzilla-c88286556a29974ea6955a6fb683a0ff35705ea5.zip |
hubloc confusion during magic auth where hublocs with more than one network may exist
Diffstat (limited to 'include/zot.php')
-rw-r--r-- | include/zot.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/zot.php b/include/zot.php index 9f2321bc4..983b73072 100644 --- a/include/zot.php +++ b/include/zot.php @@ -5286,3 +5286,25 @@ function zot_reply_notify($data) { $ret['success'] = true; json_return_and_die($ret); } + + +function zot_record_preferred($arr, $check = 'hubloc_network') { + + if(! $arr) { + return $arr; + } + + foreach($arr as $v) { + if($v[$check] === 'zot') { + return $v; + } + } + foreach($arr as $v) { + if($v[$check] === 'zot6') { + return $v; + } + } + + return $arr[0]; + +} |