Browse Source

ignore fragment portion of URL when filtering links

closes #21
main
Aaron Parecki 6 years ago
parent
commit
c5ed3c4f14
No known key found for this signature in database GPG Key ID: 276C2817346D6056
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      controllers/Controller.php

+ 2
- 0
controllers/Controller.php View File

@ -301,6 +301,8 @@ class Controller {
// Remove the source URL from the list if present // Remove the source URL from the list if present
$links = array_filter($links, function($link) use($sourceURL) { $links = array_filter($links, function($link) use($sourceURL) {
// Remove URL fragment when comparing to ignore more self-links
$link = preg_replace('/#.+$/', '', $link);
return $link != $sourceURL; return $link != $sourceURL;
}); });

Loading…
Cancel
Save