aboutsummaryrefslogtreecommitdiffstats
path: root/include/security.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2020-08-24 11:18:47 +0200
committerMario Vavti <mario@mariovavti.com>2020-08-24 11:18:47 +0200
commite9a264cb43e4c782160db645329d59db9835e388 (patch)
treeda3f8e56e8b6c3e56631325779e06c7ce7c44c98 /include/security.php
parentb996d82c5f9632e93fb3262e2a3f0da66150557b (diff)
downloadvolse-hubzilla-e9a264cb43e4c782160db645329d59db9835e388.tar.gz
volse-hubzilla-e9a264cb43e4c782160db645329d59db9835e388.tar.bz2
volse-hubzilla-e9a264cb43e4c782160db645329d59db9835e388.zip
more prefer zot6
Diffstat (limited to 'include/security.php')
-rw-r--r--include/security.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/security.php b/include/security.php
index c9df00f1e..eb18f3b21 100644
--- a/include/security.php
+++ b/include/security.php
@@ -5,6 +5,8 @@
* @brief Some security related functions.
*/
+use Zotlabs\Lib\Libzot;
+
/**
* @param int $user_record The account_id
* @param array $channel
@@ -277,14 +279,16 @@ function change_channel($change_channel) {
}
$ret = $r[0];
}
- $x = q("select * from xchan where xchan_hash = '%s' limit 1",
+ $x = q("select * from xchan where xchan_hash = '%s'",
dbesc($hash)
);
if($x) {
- $_SESSION['my_url'] = $x[0]['xchan_url'];
+ $x = Libzot::zot_record_preferred($x, 'xchan_network');
+
+ $_SESSION['my_url'] = $x['xchan_url'];
$_SESSION['my_address'] = channel_reddress($r[0]);
- App::set_observer($x[0]);
+ App::set_observer($x);
App::set_perms(get_all_perms(local_channel(), $hash));
}
if(! is_dir('store/' . $r[0]['channel_address']))