aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Activity.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-10-12 20:28:48 +0000
committerMario <mario@mariovavti.com>2020-10-12 20:28:48 +0000
commit5f93157d5a5cc824d98c39d1983d882df0a13067 (patch)
tree756c32aae616b7d7ce53e5b80fdf269dc1d54d2b /Zotlabs/Lib/Activity.php
parent8d3c201830020d63a5204df04fdcb2ae04bf2b0f (diff)
downloadvolse-hubzilla-5f93157d5a5cc824d98c39d1983d882df0a13067.tar.gz
volse-hubzilla-5f93157d5a5cc824d98c39d1983d882df0a13067.tar.bz2
volse-hubzilla-5f93157d5a5cc824d98c39d1983d882df0a13067.zip
improve find_best_identity() and fix wrong variable
Diffstat (limited to 'Zotlabs/Lib/Activity.php')
-rw-r--r--Zotlabs/Lib/Activity.php17
1 files changed, 11 insertions, 6 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;
+
}
}