diff options
author | Mario <mario@mariovavti.com> | 2023-11-07 08:46:15 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2023-11-07 08:46:15 +0000 |
commit | f74044f9b0f64ac14d0419edb1c2356e8f526f51 (patch) | |
tree | 20a42dbf2686f815783c474e373fcf4a87ca6458 /Zotlabs/Module | |
parent | 42651707f82bb0f46153eb964d828787d9ba3c3c (diff) | |
parent | 2bd09d3b305e0bf4fc81f9694f8054bdd8edc868 (diff) | |
download | volse-hubzilla-f74044f9b0f64ac14d0419edb1c2356e8f526f51.tar.gz volse-hubzilla-f74044f9b0f64ac14d0419edb1c2356e8f526f51.tar.bz2 volse-hubzilla-f74044f9b0f64ac14d0419edb1c2356e8f526f51.zip |
Merge branch 'owa_improvement' into 'dev'
work with Mastodon-style keyId
See merge request hubzilla/core!2060
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Owa.php | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/Zotlabs/Module/Owa.php b/Zotlabs/Module/Owa.php index 4de4d32d6..e41435ecd 100644 --- a/Zotlabs/Module/Owa.php +++ b/Zotlabs/Module/Owa.php @@ -30,18 +30,32 @@ class Owa extends Controller { $sigblock = HTTPSig::parse_sigheader($_SERVER['HTTP_AUTHORIZATION']); if ($sigblock) { $keyId = $sigblock['keyId']; + $parsed = parse_url($keyId); + if (str_starts_with($parsed['scheme'],'http')) { + unset($parsed['fragment']); + unset($parsed['query']); + $keyId = unparse_url($parsed); + } + else { + $keyId = str_replace('acct:', '', $keyId); + } if ($keyId) { $r = q("SELECT * FROM hubloc LEFT JOIN xchan ON hubloc_hash = xchan_hash - WHERE (hubloc_addr = '%s' OR hubloc_id_url = '%s') AND hubloc_deleted = 0 AND xchan_pubkey != '' ORDER BY hubloc_id DESC", - dbesc(str_replace('acct:', '', $keyId)), + WHERE (hubloc_addr = '%s' OR hubloc_id_url = '%s' OR xchan_hash = '%s') + AND hubloc_deleted = 0 AND xchan_pubkey != '' + ORDER BY hubloc_id DESC", + dbesc($keyId), + dbesc($keyId), dbesc($keyId) ); if (! $r) { $found = discover_by_webbie($keyId); + logger('found = ' . print_r($found, true)); if ($found) { $r = q("SELECT * FROM hubloc LEFT JOIN xchan ON hubloc_hash = xchan_hash - WHERE (hubloc_addr = '%s' OR hubloc_id_url = '%s') AND hubloc_deleted = 0 AND xchan_pubkey != '' ORDER BY hubloc_id DESC ", - dbesc(str_replace('acct:', '', $keyId)), + WHERE (hubloc_addr = '%s' OR hubloc_id_url = '%s' OR xchan_hash = '%s') AND hubloc_deleted = 0 AND xchan_pubkey != '' ORDER BY hubloc_id DESC ", + dbesc($keyId), + dbesc($keyId), dbesc($keyId) ); } |