Handle mismatched comment types properly

This commit is contained in:
Jamie Cameron
2010-06-25 11:59:03 -07:00
parent dfc0305a6b
commit d81e7ec476
3 changed files with 5 additions and 1 deletions

View File

@@ -33,3 +33,5 @@ Removed invalid "Above" options for packet flow rate.
---- Changes since 1.500 ----
Added a button to move rules to another chain.
Added a button to rename an existing custom chain.
---- Changes since 1.510 ----
Better handle the case where a rule has a --comment format description, but # format comments are enabled.

View File

@@ -38,7 +38,7 @@ print "<td>",$text{"index_chain_".lc($rule->{'chain'})} ||
&text('index_chain', "<tt>$rule->{'chain'}</tt>"),"</td> </tr>\n";
print "<tr> <td><b>$text{'edit_cmt'}</b></td>\n";
if ($config{'comment_mod'}) {
if ($config{'comment_mod'} || $rule->{'comment'}) {
# Get comment from --comment option
printf "<td><input name=cmt size=50 value='%s'></td> </tr>\n",
&html_escape($rule->{'comment'}->[1]);

View File

@@ -40,6 +40,8 @@ else {
}
else {
$rule->{'cmt'} = $in{'cmt'};
delete($rule->{'comment'});
@mods = grep { $_ ne "comment" } @mods;
}
if ($in{'jump'} eq '*') {
$in{'other'} =~ /^\S+$/ || &error($text{'save_echain'});