Browse Source

When finding links, remove the source URL from the list if present

main
Aaron Parecki 8 years ago
parent
commit
5d525a6aab
No known key found for this signature in database GPG Key ID: 3745E500B4FF7CB1
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      controllers/Controller.php

+ 5
- 0
controllers/Controller.php View File

@ -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

Loading…
Cancel
Save