mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 14:13:29 +00:00
MIME-encode headers properly when editing filters
This commit is contained in:
@@ -87,6 +87,7 @@ else {
|
||||
$regexp = 1;
|
||||
}
|
||||
}
|
||||
$condvalue = &mailbox::decode_mimewords($condvalue);
|
||||
print &ui_table_row(
|
||||
&ui_oneradio("cmode", 4, $text{'edit_cmode4'}, $cmode == 4),
|
||||
&text('edit_cheader2',
|
||||
|
||||
@@ -533,6 +533,7 @@ return wantarray ? ( $cond, $lastalways ) : $cond;
|
||||
|
||||
# prettify_regexp(string)
|
||||
# If a string contains only \ quoted special characters, remove the \s
|
||||
# Also, undo any mimewords encoding.
|
||||
sub prettify_regexp
|
||||
{
|
||||
my ($str) = @_;
|
||||
@@ -541,7 +542,7 @@ $re =~ s/\\./x/g;
|
||||
if ($re =~ /^[a-zA-Z0-9_ ]*$/) {
|
||||
$str =~ s/\\(.)/$1/g;
|
||||
}
|
||||
return $str;
|
||||
return &mailbox::decode_mimewords($str);
|
||||
}
|
||||
|
||||
# describe_action(&filter, &folder, [homedir])
|
||||
|
||||
@@ -83,7 +83,10 @@ else {
|
||||
$filter->{'condheader'} = $in{'condmenu'} || $in{'condheader'};
|
||||
$filter->{'condheader'} =~ /^[a-zA-Z0-9\-]+$/ ||
|
||||
&error($text{'save_econdheader'});
|
||||
$in{'condvalue'} = &mailbox::encode_mimeword($in{'condvalue'});
|
||||
if ($in{'condvalue'} !~ /^[\000-\177]*$/) {
|
||||
$in{'condvalue'} = &mailbox::encode_mimewords(
|
||||
$in{'condvalue'}, 'Charset' => &get_charset());
|
||||
}
|
||||
if (!$in{'condregexp'} &&
|
||||
$in{'condvalue'} =~ /[\^\$\.\*\+\?\|\(\)\[\]\{\}\\]/) {
|
||||
# If the user didn't ask for a regexp but there are
|
||||
|
||||
Reference in New Issue
Block a user