aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Entry.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Models/Entry.php')
-rw-r--r--app/Models/Entry.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/Models/Entry.php b/app/Models/Entry.php
index 747bebd71..6030451f2 100644
--- a/app/Models/Entry.php
+++ b/app/Models/Entry.php
@@ -842,8 +842,11 @@ HTML;
$path_entries_filter = trim($path_entries_filter, ', ');
foreach ($nodes as $node) {
if ($path_entries_filter !== '') {
- $filterednodes = $xpath->query((new Gt\CssXPath\Translator($path_entries_filter))->asXPath(), $node) ?: [];
+ $filterednodes = $xpath->query((new Gt\CssXPath\Translator($path_entries_filter, 'descendant-or-self::'))->asXPath(), $node) ?: [];
foreach ($filterednodes as $filterednode) {
+ if ($filterednode === $node) {
+ continue 2;
+ }
if (!($filterednode instanceof DOMElement) || $filterednode->parentNode === null) {
continue;
}