diff options
| author | 2024-09-04 21:02:46 +0200 | |
|---|---|---|
| committer | 2024-09-04 21:02:46 +0200 | |
| commit | 91d0e5099bad4675a8e8ab8cfb52e3abab1cd2ba (patch) | |
| tree | 68f43a2b1d5d97cbfb490e29a16279b70e50034d /app/Models/Entry.php | |
| parent | 2414edbd7168a9b49a2709c3f6e8fc12c8f83ad5 (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/Models/Entry.php')
| -rw-r--r-- | app/Models/Entry.php | 2 |
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, ', '); |
