mirror of
https://github.com/webmin/webmin.git
synced 2025-07-21 23:40:34 +00:00
Fix IPv6 format for regex
This commit is contained in:
@ -24,9 +24,9 @@ if ($in{'delete'}) {
|
||||
&error($text{'save_eservice'}) if ($in{'service_except_custom'} && $in{'service_except_custom'} !~ /^[\w\d\s\-\/\.,]+$/);
|
||||
|
||||
&error($text{'save_ehost'})
|
||||
if ($in{'host_text_def'} == 0 && $in{'host_text'} !~ /^[\w\d\s\-\/\@\.,]+$/ && $in{'host_text'} !~ /^\[[:\d]+\]/);
|
||||
if ($in{'host_text_def'} == 0 && $in{'host_text'} !~ /^[\w\d\s\-\/\@\.,]+$/ && $in{'host_text'} !~ /^\[[:\da-f]+\]/);
|
||||
&error($text{'save_ehost'})
|
||||
if ($in{'host_except'} && $in{'host_except'} !~ /^[\w\d\s\-\/\@\.,]+$/ && $in{'host_except'} !~ /^\[[:\d]+\]/);
|
||||
if ($in{'host_except'} && $in{'host_except'} !~ /^[\w\d\s\-\/\@\.,]+$/ && $in{'host_except'} !~ /^\[[:\da-f]+\]/);
|
||||
|
||||
for (my $i = 0; $i <= $in{'cmd_count'}; $i++) {
|
||||
&error($text{'save_ecmd'}) if ($in{'cmd_'.$i} && $in{'cmd_'.$i} !~ /^[\w\d\s\-\/\@\%\|\(\)\'\"\&\.,]+$/);
|
||||
|
@ -44,7 +44,7 @@ sub list_rules {
|
||||
my $ipv6_enc;
|
||||
|
||||
# Match ipv6 with or without range
|
||||
if ($line =~ /(?|(\[[:\d]+\]\/\d+)|(\[[:\d]+\]))/) {
|
||||
if ($line =~ /(?|(\[[:\da-f]+\]\/\d+)|(\[[:\da-f]+\]))/) {
|
||||
$ipv6 = $1;
|
||||
$ipv6_enc = &encode_base64($ipv6);
|
||||
$line =~ s/\Q$ipv6\E/$ipv6_enc/;
|
||||
|
Reference in New Issue
Block a user