deal with leading or missing @ and add more tests

This commit is contained in:
Mario Vavti
2026-03-04 10:25:32 +01:00
parent 1f265cc6d5
commit 86d58065b3
5 changed files with 103 additions and 79 deletions

View File

@@ -1267,7 +1267,12 @@ function parse_webbie($webbie) {
$result['resource'] = urlencode($webbie);
}
elseif ($parsed['scheme'] === 'acct') {
$parts = explode('@', $parsed['path']);
$parts = explode('@', ltrim($parsed['path'], '@'));
if (count($parts) !== 2) {
return false;
}
$result['host'] = $parts[1];
$result['resource'] = urlencode('acct:' . $parts[0] . '@' . $parts[1]);
}