filter tree: don't crash on search, also search by filter titles

This commit is contained in:
Andrew Dolgov 2018-12-19 09:04:04 +03:00
parent dee210e546
commit 5f1b39f7dc
1 changed files with 5 additions and 1 deletions

View File

@ -268,6 +268,10 @@ class Pref_Filters extends Handler_Protected {
$match_ok = false;
if ($filter_search) {
if (mb_strpos($line['title'], $filter_search) !== false) {
$match_ok = true;
}
$rules_sth = $this->pdo->prepare("SELECT reg_exp
FROM ttrss_filters2_rules WHERE filter_id = ?");
$rules_sth->execute([$line['id']]);
@ -752,7 +756,7 @@ class Pref_Filters extends Handler_Protected {
print "<div style='float : right; padding-right : 4px;'>
<input dojoType=\"dijit.form.TextBox\" id=\"filter_search\" size=\"20\" type=\"search\"
value=\"$filter_search\">
<button dojoType=\"dijit.form.Button\" onclick=\"updateFilterList()\">".
<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('filterTree').reload()\">".
__('Search')."</button>
</div>";