mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-17 01:54:49 +00:00
Firewall: NAT: Port Forward - php8 error when using any-{port} or {port}-any in destinations. fix local-port calculation
This commit is contained in:
parent
e101c6040d
commit
77569c29fb
@ -487,11 +487,14 @@ $( document ).ready(function() {
|
||||
|
||||
<td>
|
||||
<?php
|
||||
$localport = $natent['local-port'];
|
||||
$localport = $natent['local-port'];
|
||||
if (strpos($natent['destination']['port'],'-') !== false) {
|
||||
$natlocalport = preg_match('/^(\d){1,4}$/', $natent['local-port']) ? (int)$natent['local-port'] : 1;
|
||||
list($dstbeginport, $dstendport) = explode("-", $natent['destination']['port']);
|
||||
$localendport = $natent['local-port'] + $dstendport - $dstbeginport;
|
||||
$localport .= '-' . $localendport;
|
||||
$dstbeginport = preg_match('/^\d*$/', $dstbeginport) ? (int)$dstbeginport : 1;
|
||||
$dstendport = preg_match('/^\d*$/', $dstendport) ? (int)$dstendport : 65535;
|
||||
$localendport = $natlocalport + $dstendport - $dstbeginport;
|
||||
$localport .= '-' . $localendport ;
|
||||
}
|
||||
?>
|
||||
<?php if (isset($natent['local-port']) && is_alias($natent['local-port'])): ?>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user