aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2024-05-02 20:36:08 +0200
committerGravatar GitHub <noreply@github.com> 2024-05-02 20:36:08 +0200
commitfd7157e40ca32fb1bcda51f1aaf484cbb7988bdd (patch)
treeb4d208390164f1d9fba227ae4fa8fd1473181735
parent44625eed25f4f5cfba3ebcb4fe66c91442609eff (diff)
CSS selector trim (#6428)
fix https://github.com/FreshRSS/FreshRSS/pull/6426#issuecomment-2091159868
-rw-r--r--app/Models/Entry.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/Models/Entry.php b/app/Models/Entry.php
index 10b37aa94..ca8d9c602 100644
--- a/app/Models/Entry.php
+++ b/app/Models/Entry.php
@@ -749,11 +749,13 @@ HTML;
$content = '';
$cssSelector = htmlspecialchars_decode($feed->pathEntries(), ENT_QUOTES);
+ $cssSelector = trim($cssSelector, ', ');
$nodes = $xpath->query((new Gt\CssXPath\Translator($cssSelector))->asXPath());
if ($nodes != false) {
- $path_entries_filter = $feed->attributeString('path_entries_filter');
+ $path_entries_filter = $feed->attributeString('path_entries_filter') ?? '';
+ $path_entries_filter = trim($path_entries_filter, ', ');
foreach ($nodes as $node) {
- if ($path_entries_filter != null) {
+ if ($path_entries_filter !== '') {
$filterednodes = $xpath->query((new Gt\CssXPath\Translator($path_entries_filter))->asXPath(), $node) ?: [];
foreach ($filterednodes as $filterednode) {
if ($filterednode->parentNode === null) {