Match all schemes not just acct

This commit is contained in:
Matthew Exon 2024-07-08 20:04:34 +02:00
parent 1701156a18
commit 958d0ba554

View file

@ -69,7 +69,7 @@ class Xrd extends BaseModule
if (substr($uri, 0, 4) === 'http') { if (substr($uri, 0, 4) === 'http') {
$name = ltrim(basename($uri), '~'); $name = ltrim(basename($uri), '~');
$host = parse_url($uri, PHP_URL_HOST); $host = parse_url($uri, PHP_URL_HOST);
} else if (substr($uri, 0, 4) === 'acct') { } else if (preg_match('/^[[:alpha:]][[:alnum:]+-.]+:/', $uri)) {
$local = str_replace('acct:', '', $uri); $local = str_replace('acct:', '', $uri);
if (substr($local, 0, 2) == '//') { if (substr($local, 0, 2) == '//') {
$local = substr($local, 2); $local = substr($local, 2);