aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Module/Chanview.php18
1 files changed, 9 insertions, 9 deletions
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');
}
}
}