summaryrefslogtreecommitdiff
path: root/app/Models/Entry.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2025-01-25 09:16:13 +0100
committerGravatar GitHub <noreply@github.com> 2025-01-25 09:16:13 +0100
commitd6c2daee51fa90f000c106492141baf3824931d2 (patch)
tree98357a95438a55c9399cc1e1520c96996536b9c6 /app/Models/Entry.php
parent22b74b0a5790360d81088a83addab1f98b7f7947 (diff)
Add search operator intext: (#7228)
* Add search operator intext: fix https://github.com/FreshRSS/FreshRSS/issues/6188 https://github.com/FreshRSS/FreshRSS/discussions/7220 * Add example to doc
Diffstat (limited to 'app/Models/Entry.php')
-rw-r--r--app/Models/Entry.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/app/Models/Entry.php b/app/Models/Entry.php
index f86948122..fe0cf7429 100644
--- a/app/Models/Entry.php
+++ b/app/Models/Entry.php
@@ -673,6 +673,26 @@ HTML;
$ok &= preg_match($title, $this->title) === 0;
}
}
+ if ($ok && $filter->getIntext() !== null) {
+ foreach ($filter->getIntext() as $content) {
+ $ok &= stripos($this->content, $content) !== false;
+ }
+ }
+ if ($ok && $filter->getIntextRegex() !== null) {
+ foreach ($filter->getIntextRegex() as $content) {
+ $ok &= preg_match($content, $this->content) === 1;
+ }
+ }
+ if ($ok && $filter->getNotIntext() !== null) {
+ foreach ($filter->getNotIntext() as $content) {
+ $ok &= stripos($this->content, $content) === false;
+ }
+ }
+ if ($ok && $filter->getNotIntextRegex() !== null) {
+ foreach ($filter->getNotIntextRegex() as $content) {
+ $ok &= preg_match($content, $this->content) === 0;
+ }
+ }
if ($ok && $filter->getTags() !== null) {
foreach ($filter->getTags() as $tag2) {
$found = false;