File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments