aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Daemon/Gprobe.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2022-03-29 11:42:53 +0200
committerMario Vavti <mario@mariovavti.com>2022-03-29 11:42:53 +0200
commit0784cd593a39a4fc297e8a82f7e79bc8019a0868 (patch)
tree22182afb37cf460f8208fff9d276a0672add3185 /Zotlabs/Daemon/Gprobe.php
parent0e2e9321025f87fe9587f3d183adaea6185e4e20 (diff)
parent9c5d2ee5630dd7033904039dcd1e92db8821b644 (diff)
downloadvolse-hubzilla-7.2.tar.gz
volse-hubzilla-7.2.tar.bz2
volse-hubzilla-7.2.zip
Merge branch '7.2RC'7.2
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']);
}