aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2024-09-04 21:02:46 +0200
committerGravatar GitHub <noreply@github.com> 2024-09-04 21:02:46 +0200
commit91d0e5099bad4675a8e8ab8cfb52e3abab1cd2ba (patch)
tree68f43a2b1d5d97cbfb490e29a16279b70e50034d /app
parent2414edbd7168a9b49a2709c3f6e8fc12c8f83ad5 (diff)
Fix XPath for HTML documents with broken root (#6774)
fix https://github.com/FreshRSS/FreshRSS/issues/6773 The default `.//` prefix for the XPath does not to work for documents, which have content after the end of their main node
Diffstat (limited to 'app')
-rw-r--r--app/Models/Entry.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/Models/Entry.php b/app/Models/Entry.php
index cd7b27291..f2701fb68 100644
--- a/app/Models/Entry.php
+++ b/app/Models/Entry.php
@@ -785,7 +785,7 @@ HTML;
$content = '';
$cssSelector = htmlspecialchars_decode($feed->pathEntries(), ENT_QUOTES);
$cssSelector = trim($cssSelector, ', ');
- $nodes = $xpath->query((new Gt\CssXPath\Translator($cssSelector))->asXPath());
+ $nodes = $xpath->query((new Gt\CssXPath\Translator($cssSelector, '//'))->asXPath());
if ($nodes != false) {
$path_entries_filter = $feed->attributeString('path_entries_filter') ?? '';
$path_entries_filter = trim($path_entries_filter, ', ');