From c5ed3c4f146e118f701b391bbd77af7cf4ddca32 Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Mon, 14 May 2018 13:20:29 -0700 Subject: [PATCH] ignore fragment portion of URL when filtering links closes #21 --- controllers/Controller.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/controllers/Controller.php b/controllers/Controller.php index 2509850..bc132f4 100644 --- a/controllers/Controller.php +++ b/controllers/Controller.php @@ -301,6 +301,8 @@ class Controller { // Remove the source URL from the list if present $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; });