From 2690159f09ff5104a4f3d3cfb5d5e326a6f28d1a Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 7 Oct 2020 08:02:04 +0000 Subject: 5.0RC testing: use the zot6 xchan if available --- Zotlabs/Module/Chanview.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Zotlabs/Module/Chanview.php') diff --git a/Zotlabs/Module/Chanview.php b/Zotlabs/Module/Chanview.php index 06ff10f9e..12e1891d4 100644 --- a/Zotlabs/Module/Chanview.php +++ b/Zotlabs/Module/Chanview.php @@ -17,19 +17,19 @@ class Chanview extends \Zotlabs\Web\Controller { $r = null; if($_REQUEST['hash']) { - $r = q("select * from xchan where xchan_hash = '%s' limit 1", + $r = q("select * from xchan where xchan_hash = '%s'", dbesc($_REQUEST['hash']) ); } if($_REQUEST['address']) { - $r = q("select * from xchan where xchan_addr = '%s' limit 1", + $r = q("select * from xchan where xchan_addr = '%s'", dbesc(punify($_REQUEST['address'])) ); } elseif(local_channel() && intval($_REQUEST['cid'])) { $r = q("SELECT abook.*, xchan.* FROM abook left join xchan on abook_xchan = xchan_hash - WHERE abook_channel = %d and abook_id = %d LIMIT 1", + WHERE abook_channel = %d and abook_id = %d", intval(local_channel()), intval($_REQUEST['cid']) ); @@ -39,12 +39,12 @@ class Chanview extends \Zotlabs\Web\Controller { // if somebody re-installed they will have more than one xchan, use the most recent name date as this is // the most useful consistently ascending table item we have. - $r = q("select * from xchan where xchan_url = '%s' order by xchan_name_date desc limit 1", + $r = q("select * from xchan where xchan_url = '%s' order by xchan_name_date desc", dbesc($_REQUEST['url']) ); } if($r) { - App::$poi = $r[0]; + App::$poi = Libzot::zot_record_preferred($r, 'xchan_network'); } @@ -71,20 +71,20 @@ class Chanview extends \Zotlabs\Web\Controller { if(array_path_exists('signature/signer',$zf) && $zf['signature']['signer'] === $_REQUEST['url'] && intval($zf['signature']['header_valid'])) { Libzot::import_xchan($j); - $r = q("select * from xchan where xchan_url = '%s' limit 1", + $r = q("select * from xchan where xchan_url = '%s'", dbesc($_REQUEST['url']) ); if($r) { - App::$poi = $r[0]; + App::$poi = Libzot::zot_record_preferred($r, 'xchan_network'); } } if(! $r) { if(discover_by_webbie($_REQUEST['url'])) { - $r = q("select * from xchan where xchan_url = '%s' limit 1", + $r = q("select * from xchan where xchan_url = '%s'", dbesc($_REQUEST['url']) ); if($r) { - App::$poi = $r[0]; + App::$poi = Libzot::zot_record_preferred($r, 'xchan_network'); } } } -- cgit v1.2.3