From ec1f8a3d8ae9e00ea980c1b8f7cef158209be47d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 25 Mar 2013 20:08:34 +0400 Subject: [PATCH] fix inverse rule to only mean negative regexp matching except for whole rule (refs #631) --- classes/pref/filters.php | 12 +++++------- include/functions.php | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/classes/pref/filters.php b/classes/pref/filters.php index 5ea4fe59..883ff0eb 100644 --- a/classes/pref/filters.php +++ b/classes/pref/filters.php @@ -792,6 +792,11 @@ class Pref_Filters extends Handler_Protected { style=\"font-size : 16px; width : 20em;\" name=\"reg_exp\" value=\"$reg_exp\"/>"; + print "
"; + print ""; + print ""; + print "
" . __("on field") . " "; print_select_hash("filter_type", $filter_type, $filter_types, 'dojoType="dijit.form.Select"'); @@ -806,13 +811,6 @@ class Pref_Filters extends Handler_Protected { 'dojoType="dijit.form.FilteringSelect"'); print ""; - print "

"; - - print ""; - - print ""; - print ""; print "

"; diff --git a/include/functions.php b/include/functions.php index 9a855a9b..682ffd2e 100644 --- a/include/functions.php +++ b/include/functions.php @@ -3905,6 +3905,8 @@ break; } + if (isset($rule['inverse'])) $qpart = "NOT ($qpart)"; + if (isset($rule["feed_id"]) && $rule["feed_id"] > 0) { $qpart .= " AND feed_id = " . db_escape_string($link, $rule["feed_id"]); } @@ -3925,8 +3927,6 @@ $qpart .= " AND $cat_qpart"; } - if (isset($rule['inverse'])) $qpart = "NOT ($qpart)"; - array_push($query, "($qpart)"); } -- 2.39.5