Parcourir la source

added sanity check for editing Header filters

bbice il y a 23 ans
Parent
commit
1149f01c2e
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  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;