diff options
-rw-r--r-- | Zotlabs/Lib/Activity.php | 17 | ||||
-rw-r--r-- | Zotlabs/Lib/Libzot.php | 4 |
2 files changed, 13 insertions, 8 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index f3885033b..4886f9239 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -3185,14 +3185,19 @@ class Activity { } static function find_best_identity($xchan) { - $r = q("select hubloc_hash, hubloc_network from hubloc where hubloc_id_url = '%s'", - dbesc($xchan) - ); - if ($r) { - $r = Libzot::zot_record_preferred($r); - return $r['hubloc_hash']; + + if(filter_var($xchan, FILTER_VALIDATE_URL)) { + $r = q("select hubloc_hash, hubloc_network from hubloc where hubloc_id_url = '%s'", + dbesc($xchan) + ); + if ($r) { + $r = Libzot::zot_record_preferred($r); + return $r['hubloc_hash']; + } } + return $xchan; + } } diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index fb64626d6..654b0461b 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -1469,8 +1469,8 @@ class Libzot { // Make sure we use the zot6 identity where applicable - $msg_arr['author_xchan'] = Activity::find_best_identity($msg_arr['author_xchan']); - $msg_arr['owner_xchan'] = Activity::find_best_identity($msg_arr['owner_xchan']); + $arr['author_xchan'] = Activity::find_best_identity($arr['author_xchan']); + $arr['owner_xchan'] = Activity::find_best_identity($arr['owner_xchan']); // We've validated the sender. Now make sure that the sender is the owner or author |