Fix to properly handle matching comma-separated named ports

This commit is contained in:
Ilia Ross
2024-11-17 17:41:35 +02:00
parent 5931243e4d
commit 23871ff3a9

View File

@@ -50,7 +50,10 @@ else {
# Validate ports (1234 or 1234:1245 or 1234:1245,1250,http or 1238,http,https)
$in{'port'} =~ s/\s+//g if ($in{'port'});
!$in{'port'} || $in{'port'} =~ /^(?!$)(?:[a-zA-Z]+|\d{1,5})(?:(?::\d{1,5})?)(?:,(?:[a-zA-Z]+|\d{1,5})(?:(?::\d{1,5})?)?)*$/gmi || &error($text{'jail_eports'});
!$in{'port'} || $in{'port'} =~
/^(?!$)(?:[a-zA-Z0-9]+|\d{1,5})(?::\d{1,5})?
(?:,\s*(?:[a-zA-Z0-9]+|\d{1,5})(?::\d{1,5})?)*$/gmix ||
&error($text{'jail_eports'});
# Parse and validate actions
my @actions;