summaryrefslogtreecommitdiff
path: root/app/Models/Entry.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2024-12-10 13:50:44 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2024-12-10 13:50:44 +0100
commit33fd07f6f26310d4806077cc87bcdf9b8b940e35 (patch)
tree97e49bc0769e0f5727a71f952b0c2b4953123244 /app/Models/Entry.php
parent88eef9832b7325158a913e203846e5a57829f307 (diff)
Conditional retrieval
fix https://github.com/FreshRSS/FreshRSS/issues/6149
Diffstat (limited to 'app/Models/Entry.php')
-rw-r--r--app/Models/Entry.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/Models/Entry.php b/app/Models/Entry.php
index cccfac5e1..441730af2 100644
--- a/app/Models/Entry.php
+++ b/app/Models/Entry.php
@@ -814,6 +814,22 @@ HTML;
if ($url === '' || $feed === null || $feed->pathEntries() === '') {
return '';
}
+ if (!empty($feed->attributeArray('path_entries_condition'))) {
+ $found = false;
+ foreach ($feed->attributeArray('path_entries_condition') as $condition) {
+ if (trim($condition) === '') {
+ continue;
+ }
+ $booleanSearch = new FreshRSS_BooleanSearch($condition);
+ if ($this->matches($booleanSearch)) {
+ $found = true;
+ break;
+ }
+ }
+ if (!$found) {
+ return '';
+ }
+ }
$cachePath = $feed->cacheFilename($url . '#' . $feed->pathEntries());
$html = httpGet($url, $cachePath, 'html', $feed->attributes(), $feed->curlOptions());