misc fixes from downstream

This commit is contained in:
Mike Macgirvin 2024-09-15 07:09:17 +10:00
parent 1076c7edcb
commit 5d4521b856
3 changed files with 4 additions and 4 deletions

View file

@ -2247,7 +2247,7 @@ class Activity
// The xchan should have been created by actor_store() above // The xchan should have been created by actor_store() above
$r = q( $r = q(
"select * from xchan where xchan_hash = '%s' and xchan_network = 'activitypub' limit 1", "select * from xchan where xchan_hash = '%s' and xchan_network in ('activitypub', 'apnomadic') limit 1",
dbesc($actorId->getId()) dbesc($actorId->getId())
); );

View file

@ -194,14 +194,14 @@ class Import extends Controller
$eprvkey = $multibase->decode($data['privateKeyMultibase']); $eprvkey = $multibase->decode($data['privateKeyMultibase']);
if ($epubkey && $eprvkey) { if ($epubkey && $eprvkey) {
$existing = q("select * from channel where epubkey = '%s'", $existing = q("select * from channel where channel_epubkey = '%s'",
dbesc($epubkey) dbesc($epubkey)
); );
if ($existing) { if ($existing) {
notice(t('Identity key is already being used on this instance.')); notice(t('Identity key is already being used on this instance.'));
return; return;
} }
q("update channel set epubkey = '%s', eprivkey = '%s' where channel_id = %d", q("update channel set channel_epubkey = '%s', eprivkey = '%s' where channel_id = %d",
dbesc($epubkey), dbesc($epubkey),
dbesc($eprvkey), dbesc($eprvkey),
intval($channel['channel_id']) intval($channel['channel_id'])

View file

@ -47,7 +47,7 @@ class _1271
public function verify() public function verify()
{ {
$columns = db_columns('channel'); $columns = db_columns('channel');
return in_array('epubkey', $columns) && in_array('eprvkey', $columns); return in_array('channel_epubkey', $columns) && in_array('channel_eprvkey', $columns);
} }
} }