Closed heull001 closed 1 year ago
The filter
method returning false
will cause the item to be skipped:
That only happens when neither the title or the the content matches the filter (the line you point to):
Equivalently, the method could be written as:
protected function filter($source, $title, $content) {
if (strlen(trim($source['filter'])) === 0) {
return false
}
$resultTitle = @preg_match($source['filter'], $title);
$resultContent = @preg_match($source['filter'], $content);
if ($resultTitle === false || $resultContent === false) {
$this->logger->error('filter error: ' . $source['filter']);
return true; // do not filter out item
}
// test filter
if ($resultTitle !== 0 || $resultContent !== 0) {
return true;
}
return false;
}
helpers/src/ContentLoader.php line 336ff: if ($resultTitle === 0 && $resultContent === 0) { return false; }
I think, this should be ||. Otherwise users have to build a filter-expression, which works for the title and the content, I don't think, this is right.