diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2023-12-16 16:05:52 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2023-12-16 16:05:52 +0100 |
commit | 19dd1fe86605bc85e8a0bf4efd6f195db258f60a (patch) | |
tree | 5d5b1fac3ad1760189ea0daf1bf5639e4ba0d100 /Zotlabs/Module/Owa.php | |
parent | 6a5f78543fb2f5329e54209253b8c0d0f1d7a91d (diff) | |
parent | 69266cd6c65d228320dede32a343a9d3f3ea63df (diff) | |
download | volse-hubzilla-19dd1fe86605bc85e8a0bf4efd6f195db258f60a.tar.gz volse-hubzilla-19dd1fe86605bc85e8a0bf4efd6f195db258f60a.tar.bz2 volse-hubzilla-19dd1fe86605bc85e8a0bf4efd6f195db258f60a.zip |
Merge branch 'dev' into tests/test-db-setup-wip
Diffstat (limited to 'Zotlabs/Module/Owa.php')
-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) ); } |