added sanity check for editing Header filters
authorbbice <bbice@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 13 Apr 2002 07:41:08 +0000 (07:41 +0000)
committerbbice <bbice@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 13 Apr 2002 07:41:08 +0000 (07:41 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2718 7612ce4b-ef26-0410-bec9-ea0150e637f0

plugins/filters/options.php

index cbf2c152a0a05bc446744554be9cdddd123f2bc7..ec836f65a9c9f5a2682f5d98c6fc42c359de70a2 100644 (file)
       $filter_what = str_replace("\\\"", "\"", $filter_what);
       $filter_what = str_replace("\"", "&quot;", $filter_what);
 
       $filter_what = str_replace("\\\"", "\"", $filter_what);
       $filter_what = str_replace("\"", "&quot;", $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;
       setPref($data_dir, $username, "filter".$theid, $filter_where.",".$filter_what.",".$filter_folder);
       $filters[$theid]["where"] = $filter_where;
       $filters[$theid]["what"] = $filter_what;