diff options
author | Mario <mario@mariovavti.com> | 2022-02-28 10:16:19 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2022-02-28 10:16:19 +0000 |
commit | 0cc6f66a26181319738db8150074f62b3684f97e (patch) | |
tree | da50b9238b562ebb65b676e38e33a18b94dc9ac6 /Zotlabs/Daemon | |
parent | 1893368aa51c1c703f760f9f15bacb1bf42c750d (diff) | |
download | volse-hubzilla-0cc6f66a26181319738db8150074f62b3684f97e.tar.gz volse-hubzilla-0cc6f66a26181319738db8150074f62b3684f97e.tar.bz2 volse-hubzilla-0cc6f66a26181319738db8150074f62b3684f97e.zip |
make gprobe deal with URLs, fix issue in get_actor_protocols and fix missing author issue if wall2wall comment arrives and author is not yet known
Diffstat (limited to 'Zotlabs/Daemon')
-rw-r--r-- | Zotlabs/Daemon/Gprobe.php | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/Zotlabs/Daemon/Gprobe.php b/Zotlabs/Daemon/Gprobe.php index 29efcf475..1124ead54 100644 --- a/Zotlabs/Daemon/Gprobe.php +++ b/Zotlabs/Daemon/Gprobe.php @@ -15,19 +15,31 @@ class Gprobe { return; $url = hex2bin($argv[1]); + $is_webbie = false; + $r = null; - if (!strpos($url, '@')) - return; + if (filter_var($url, FILTER_VALIDATE_EMAIL)) { + $is_webbie = true; - $r = q("select * from hubloc where hubloc_addr = '%s' and hubloc_network = 'zot6' limit 1", - dbesc($url) - ); + $r = q("select * from hubloc where hubloc_addr = '%s' and hubloc_network = 'zot6' limit 1", + dbesc($url) + ); + } + elseif (filter_var($url, FILTER_VALIDATE_URL)) { + $r = q("select * from hubloc where hubloc_id_url = '%s' and hubloc_network = 'zot6' limit 1", + dbesc($url) + ); + } if (!$r) { - $href = Webfinger::zot_url(punify($url)); - if ($href) { - $zf = Zotfinger::exec($href, null); + if ($is_webbie) { + $url = Webfinger::zot_url(punify($url)); } + + if ($url) { + $zf = Zotfinger::exec($url, null); + } + if (is_array($zf) && array_path_exists('signature/signer', $zf) && $zf['signature']['signer'] === $href && intval($zf['signature']['header_valid'])) { Libzot::import_xchan($zf['data']); } |