]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix inverse rule to only mean negative regexp matching except for whole rule (refs...
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 25 Mar 2013 16:08:34 +0000 (20:08 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 25 Mar 2013 16:09:37 +0000 (20:09 +0400)
classes/pref/filters.php
include/functions.php

index 5ea4fe59d04e91e48eb9cb35a3431854781e2861..883ff0ebdfa991946d724ef0d14390f2f48d7bb5 100644 (file)
@@ -792,6 +792,11 @@ class Pref_Filters extends Handler_Protected {
                         style=\"font-size : 16px; width : 20em;\"
                         name=\"reg_exp\" value=\"$reg_exp\"/>";
 
+               print "<hr/>";
+               print "<input id=\"filterDlg_inverse\" dojoType=\"dijit.form.CheckBox\"
+                        name=\"inverse\" $inverse_checked/>";
+               print "<label for=\"filterDlg_inverse\">".__("Inverse regular expression matching")."</label>";
+
                print "<hr/>" .  __("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 "</span>";
 
-               print "<p>";
-
-               print "<input id=\"filterDlg_inverse\" dojoType=\"dijit.form.CheckBox\"
-                        name=\"inverse\" $inverse_checked/>";
-
-               print "<label for=\"filterDlg_inverse\">".__("Inverse matching")."</label>";
-
                print "</div>";
 
                print "<div class=\"dlgButtons\">";
index 9a855a9bca470ab269cf2cba0aa1e69b061f27b9..682ffd2ee8cdc688039926aa7e3e1d6e889727a6 100644 (file)
                                                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"]);
                                }
                                        $qpart .= " AND $cat_qpart";
                                }
 
-                               if (isset($rule['inverse'])) $qpart = "NOT ($qpart)";
-
                                array_push($query, "($qpart)");
 
                        }