Explorar o código

added sanity check for editing Header filters

bbice %!s(int64=23) %!d(string=hai) anos
pai
achega
1149f01c2e
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      plugins/filters/options.php

+ 4 - 0
plugins/filters/options.php

@@ -42,6 +42,10 @@
       $filter_what = str_replace("\\\"", "\"", $filter_what);
       $filter_what = str_replace("\"", """, $filter_what);
 
+      if (($filter_where == 'Header') && (strchr($filter_what,':') == '')) {
+         print ('WARNING! Header filters should be of the format "Header: value"<BR>');
+	 $action = 'edit';
+      }
       setPref($data_dir, $username, "filter".$theid, $filter_where.",".$filter_what.",".$filter_folder);
       $filters[$theid]["where"] = $filter_where;
       $filters[$theid]["what"] = $filter_what;