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.php3
1 files changed, 1 insertions, 2 deletions
diff --git a/app/Models/Entry.php b/app/Models/Entry.php
index 0919489fc..f86948122 100644
--- a/app/Models/Entry.php
+++ b/app/Models/Entry.php
@@ -879,9 +879,8 @@ HTML;
if ($nodes != false) {
$filter_xpath = $path_entries_filter === '' ? '' : (new Gt\CssXPath\Translator($path_entries_filter, 'descendant-or-self::'))->asXPath();
foreach ($nodes as $node) {
- if ($filter_xpath !== '') {
+ if ($filter_xpath !== '' && ($filterednodes = $xpath->query($filter_xpath, $node)) !== false) {
// Remove unwanted elements once before sanitizing, for CSS selectors to also match original content
- $filterednodes = $xpath->query($filter_xpath, $node) ?: [];
foreach ($filterednodes as $filterednode) {
if ($filterednode === $node) {
continue 2;