diff --git a/src/Module/Acctlink.php b/src/Module/Acctlink.php index 4093e3cd8e..81b2c2391c 100644 --- a/src/Module/Acctlink.php +++ b/src/Module/Acctlink.php @@ -34,15 +34,15 @@ class Acctlink extends BaseModule public function rawContent() { $addr = trim($_GET['addr'] ?? ''); - - if ($addr) { - $url = Contact::getByURL($addr)['url'] ?? ''; - if ($url) { - System::externalRedirect($url['url']); - exit(); - } + if (!$addr) { + throw new NotFoundException('Parameter "addr" is missing or empty'); } - throw new NotFoundException('Parameter "url" is missing'); + $contact = Contact::getByURL($addr, null, ['url']) ?? ''; + if (!$contact) { + throw new NotFoundException('Contact not found'); + } + + System::externalRedirect($contact['url']); } } diff --git a/tests/src/App/ModuleTest.php b/tests/src/App/ModuleControllerTest.php similarity index 100% rename from tests/src/App/ModuleTest.php rename to tests/src/App/ModuleControllerTest.php