stop sending matched content twice for the tooltip, use smaller objects containing only regular expression and rule type
This commit is contained in:
@@ -171,6 +171,7 @@ class Pref_Filters extends Handler_Protected {
|
||||
$content_preview = "";
|
||||
|
||||
$matches = [];
|
||||
$rules = [];
|
||||
|
||||
$entry_title = $entry["title"];
|
||||
|
||||
@@ -184,6 +185,11 @@ class Pref_Filters extends Handler_Protected {
|
||||
|
||||
$matches[] = $rule_regexp_match;
|
||||
|
||||
$rules[] = [
|
||||
'reg_exp' => $rule['reg_exp'],
|
||||
'type' => $rule['type']
|
||||
];
|
||||
|
||||
if (in_array($rule['type'], ['content', 'both'])) {
|
||||
// also stripping [\r\n\t] to match what's done for content in RSSUtils#get_article_filters()
|
||||
$entry_content_text = strip_tags(preg_replace("/[\r\n\t]/", "", $entry["content"]));
|
||||
@@ -232,7 +238,7 @@ class Pref_Filters extends Handler_Protected {
|
||||
'feed_title' => $entry['feed_title'],
|
||||
'date' => mb_substr($entry['date_entered'], 0, 16),
|
||||
'content_preview' => $content_preview,
|
||||
'matched_rules' => $matched_rules, // TODO shorten object passed to frontend
|
||||
'rules' => $rules
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user