Skip to content

Commit 7d5fa88

Browse files
committed
Fixed: FS#748 - ispconfig vs firewall port range
1 parent 0b72534 commit 7d5fa88

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

server/plugins-available/firewall_plugin.inc.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,27 @@ function update($event_name,$data) {
7979
$ports = explode(',',$data["new"]["tcp_port"]);
8080
if(is_array($ports)) {
8181
foreach($ports as $p) {
82-
$p_int = intval($p);
83-
if($p_int > 0) $tcp_ports .= $p_int . ' ';
82+
if(strstr($p,':')) {
83+
$p_parts = explode(':',$p);
84+
$p_clean = intval($p_parts[0]).':'.intval($p_parts[1]);
85+
} else {
86+
$p_clean = intval($p);
87+
}
88+
if($p_int > 0) $tcp_ports .= $p_clean . ' ';
8489
}
8590
}
8691
$tcp_ports = trim($tcp_ports);
8792

8893
$ports = explode(',',$data["new"]["udp_port"]);
8994
if(is_array($ports)) {
9095
foreach($ports as $p) {
91-
$p_int = intval($p);
92-
if($p_int > 0) $udp_ports .= $p_int . ' ';
96+
if(strstr($p,':')) {
97+
$p_parts = explode(':',$p);
98+
$p_clean = intval($p_parts[0]).':'.intval($p_parts[1]);
99+
} else {
100+
$p_clean = intval($p);
101+
}
102+
if($p_int > 0) $udp_ports .= $p_clean . ' ';
93103
}
94104
}
95105
$udp_ports = trim($udp_ports);

0 commit comments

Comments
 (0)