diff --git a/controllers/Controller.php b/controllers/Controller.php index 1a0a227..10475f3 100644 --- a/controllers/Controller.php +++ b/controllers/Controller.php @@ -282,6 +282,11 @@ class Controller { $links = array_values($client->findOutgoingLinks($parsed)); + // Remove the source URL from the list if present + $links = array_filter($links, function($link) use($sourceURL) { + return $link != $sourceURL; + }); + $response->headers->set('Content-Type', 'application/json'); $response->setContent(json_encode([ 'links' => $links