diff options
| author | 2024-11-30 21:17:45 +0100 | |
|---|---|---|
| committer | 2024-11-30 21:17:45 +0100 | |
| commit | d89563ab404b933b07b8b10a9e32fcc9ee71357a (patch) | |
| tree | 0017094d3a4269b5a777b6d7efbd85773a8a468c /app | |
| parent | a41aadf02add2e326a1cfa320022e5db3600f9d4 (diff) | |
Fix CSS selector for removing elements (#7037)
fix https://github.com/FreshRSS/FreshRSS/issues/7014
Case of negative filter matching the positive filter
Diffstat (limited to 'app')
| -rw-r--r-- | app/Models/Entry.php | 5 |
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; } |
