From 91d0e5099bad4675a8e8ab8cfb52e3abab1cd2ba Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Wed, 4 Sep 2024 21:02:46 +0200 Subject: 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 --- app/Models/Entry.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/Models/Entry.php') 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, ', '); -- cgit v1.2.3