diff options
author | Andrew Dolgov <[email protected]> | 2018-12-06 23:12:20 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2018-12-06 23:12:20 +0300 |
commit | 1e3a53c037d36a49214f914a143da8b4b39debad (patch) | |
tree | eacc43275c7dc1e2f5b42774fce13f0bf0520f84 /classes | |
parent | 5780a5d5013ffd4f93d1e6acee2ca3037c6f1210 (diff) |
do not try to update filter triggers if nothing was triggered (properly this time)
Diffstat (limited to 'classes')
-rwxr-xr-x | classes/rssutils.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/classes/rssutils.php b/classes/rssutils.php index cc011d61a..65dd35043 100755 --- a/classes/rssutils.php +++ b/classes/rssutils.php @@ -781,13 +781,15 @@ class RSSUtils { $plugin->hook_filter_triggered($feed, $owner_uid, $article, $matched_filters, $matched_rules, $article_filters); } - $matched_filter_ids = implode(",", array_map(function($f) { return $f['id']; }, $matched_filters)); + $matched_filter_ids = array_map(function($f) { return $f['id']; }, $matched_filters); + if (count($matched_filter_ids) > 0) { + $filter_ids_qmarks = arr_qmarks($matched_filter_ids); - if ($matched_filter_ids) { $fsth = $pdo->prepare("UPDATE ttrss_filters2 SET last_triggered = NOW() WHERE - id IN (?) AND owner_uid = ?"); - $fsth->execute([$matched_filter_ids, $owner_uid]); + id IN ($filter_ids_qmarks) AND owner_uid = ?"); + + $fsth->execute(array_merge($matched_filter_ids, [$owner_uid])); } if (Debug::get_loglevel() >= Debug::$LOG_EXTENDED) { |