Fix prefs so they work under 4.2 as well as 4.1.x. This really needs to
[squirrelmail.git] / plugins / filters / options.php
index 0b3f0e19963a3ea25f407ae7c8459e8331495779..ec836f65a9c9f5a2682f5d98c6fc42c359de70a2 100644 (file)
       $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;
         $sel = (($L && $filters[$theid]['where'] == 'Subject')?'selected':'');
         echo "<option value=\"Subject\" $sel>" . _ ("Subject") . '</option>';
 
+        $sel = (($L && $filters[$theid]['where'] == 'Header')?'selected':'');
+        echo "<option value=\"Header\" $sel>" . _ ("Header") . '</option>';
+
         echo         '</select>'.
                 '</td>'.
             '</tr>'.
         if (isset($filters[$i + 1])) {
             echo "<a href=\"options.php?theid=$i&action=move_down\">" . _("Down") . '</a>';
             if ($i > 0) {
-                echo ' | ';
+                echo '&nbsp;|&nbsp;';
             }
         }
         if ($i > 0) {
             echo "<a href=\"options.php?theid=$i&action=move_up\">" . _("Up") . '</a>';
         }
-        echo ']</small></td><td> - ';
+        echo ']</small></td><td>-</td><td>';
         printf( _("If <b>%s</b> contains <b>%s</b> then move to <b>%s</b>"), _($filters[$i]['where']), $filters[$i]['what'], $fdr );
         echo '</td></tr>';