浏览代码

added sanity check for editing Header filters

bbice 23 年之前
父节点
当前提交
1149f01c2e
共有 1 个文件被更改,包括 4 次插入0 次删除
  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);
       $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);
       setPref($data_dir, $username, "filter".$theid, $filter_where.",".$filter_what.",".$filter_folder);
       $filters[$theid]["where"] = $filter_where;
       $filters[$theid]["where"] = $filter_where;
       $filters[$theid]["what"] = $filter_what;
       $filters[$theid]["what"] = $filter_what;