diff --git a/backend.php b/backend.php
index 8c4dbcfe3..24b738204 100644
--- a/backend.php
+++ b/backend.php
@@ -2146,10 +2146,10 @@
if (!WEB_DEMO_MODE) {
- $regexp = db_escape_string(trim($_GET["regexp"]));
- $match = db_escape_string(trim($_GET["match"]));
- $feed_id = db_escape_string($_GET["fid"]);
- $action_id = db_escape_string($_GET["aid"]);
+ $regexp = db_escape_string(trim($_GET["reg_exp"]));
+ $match_id = db_escape_string(trim($_GET["match_id"]));
+ $feed_id = db_escape_string($_GET["feed_id"]);
+ $action_id = db_escape_string($_GET["action_id"]);
if (!$feed_id) {
$feed_id = 'NULL';
@@ -2161,8 +2161,7 @@
"INSERT INTO ttrss_filters (reg_exp,filter_type,owner_uid,feed_id,
action_id)
VALUES
- ('$regexp', (SELECT id FROM ttrss_filter_types WHERE
- description = '$match'),'".$_SESSION["uid"]."',
+ ('$regexp', '$match_id','".$_SESSION["uid"]."',
$feed_id, '$action_id')");
}
}
@@ -2742,41 +2741,48 @@
print "
";
+ print "
";
+
}
print "
";
diff --git a/functions.js b/functions.js
index ee26d0a92..627eb287a 100644
--- a/functions.js
+++ b/functions.js
@@ -992,13 +992,15 @@ function displayDlg(id, param) {
function infobox_submit_callback() {
if (xmlhttp.readyState == 4) {
- notify(xmlhttp.responseText);
closeInfoBox();
// called from prefs, reload tab
if (active_tab) {
selectTab(active_tab, false);
}
+
+ notify(xmlhttp.responseText);
+
}
}
@@ -1024,29 +1026,11 @@ function qaddFilter() {
return
}
- var regexp = document.getElementById("fadd_regexp");
- var match = document.getElementById("fadd_match");
- var feed = document.getElementById("fadd_feed");
- var action = document.getElementById("fadd_action");
-
- if (regexp.value.length == 0) {
- alert("Missing filter expression.");
- } else {
- notify("Adding filter...");
+ var query = Form.serialize("filter_add_form");
- var v_match = match[match.selectedIndex].text;
- var feed_id = feed[feed.selectedIndex].id;
- var action_id = action[action.selectedIndex].id;
-
- xmlhttp.open("GET", "backend.php?op=pref-filters&quiet=1&subop=add®exp=" +
- param_escape(regexp.value) + "&match=" + v_match +
- "&fid=" + param_escape(feed_id) + "&aid=" + param_escape(action_id), true);
-
- xmlhttp.onreadystatechange=infobox_submit_callback;
- xmlhttp.send(null);
-
- regexp.value = "";
- }
+ xmlhttp.open("GET", "backend.php?" + query, true);
+ xmlhttp.onreadystatechange=infobox_submit_callback;
+ xmlhttp.send(null);
}
diff --git a/functions.php b/functions.php
index 0f05f8aec..d9df9ca3a 100644
--- a/functions.php
+++ b/functions.php
@@ -653,7 +653,7 @@
}
function print_select($id, $default, $values, $attributes = "") {
- print "