From 5368f38753a3e655ed3d7d7dfc7af2cc22de7980 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 10 Jan 2025 08:13:09 +0100 Subject: Reduce undeeded use of elvis operator ?: (#7204) --- app/Models/Entry.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'app/Models/Entry.php') 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; -- cgit v1.2.3