Skip to content

Commit 198f8ea

Browse files
committed
added port range aligner
1 parent d1ad91d commit 198f8ea

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

web/edit/firewall/index.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@
4848
$v_rule = escapeshellarg($_GET['rule']);
4949
$v_action = escapeshellarg($_POST['v_action']);
5050
$v_protocol = escapeshellarg($_POST['v_protocol']);
51-
$v_port = escapeshellarg($_POST['v_port']);
51+
$v_port = str_replace(" ",",", $_POST['v_port']);
52+
$v_port = preg_replace('/\,+/', ',', $v_port);
53+
$v_port = trim($v_port, ",");
54+
$v_port = escapeshellarg($v_port);
5255
$v_ip = escapeshellarg($_POST['v_ip']);
5356
$v_comment = escapeshellarg($_POST['v_comment']);
5457

@@ -60,7 +63,9 @@
6063
$v_rule = $_GET['v_rule'];
6164
$v_action = $_POST['v_action'];
6265
$v_protocol = $_POST['v_protocol'];
63-
$v_port = $_POST['v_port'];
66+
$v_port = str_replace(" ",",", $_POST['v_port']);
67+
$v_port = preg_replace('/\,+/', ',', $v_port);
68+
$v_port = trim($v_port, ",");
6469
$v_ip = $_POST['v_ip'];
6570
$v_comment = $_POST['v_comment'];
6671

0 commit comments

Comments
 (0)