aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Daemon/Gprobe.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-02-28 10:16:19 +0000
committerMario <mario@mariovavti.com>2022-02-28 10:16:19 +0000
commit0cc6f66a26181319738db8150074f62b3684f97e (patch)
treeda50b9238b562ebb65b676e38e33a18b94dc9ac6 /Zotlabs/Daemon/Gprobe.php
parent1893368aa51c1c703f760f9f15bacb1bf42c750d (diff)
downloadvolse-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/Gprobe.php')
-rw-r--r--Zotlabs/Daemon/Gprobe.php28
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']);
}