diff --git a/includes/dhcp.php b/includes/dhcp.php index c6cc91d9..5c7752a1 100755 --- a/includes/dhcp.php +++ b/includes/dhcp.php @@ -112,25 +112,30 @@ function DisplayDHCPConfig() { $RangeStart = $arrRange[0]; $RangeEnd = $arrRange[1]; $RangeMask = $arrRange[2]; - preg_match( '/([0-9]*)([a-z])/i', $arrRange[3], $arrRangeLeaseTime ); + $leaseTime = $arrRange[3]; $hselected = ''; $mselected = ''; $dselected = ''; - - switch( $arrRangeLeaseTime[2] ) { - case 'h': - $hselected = ' selected="selected"'; - break; - case 'm': - $mselected = ' selected="selected"'; - break; - case 'd': - $dselected = ' selected="selected"'; - break; + $infiniteselected = ''; + preg_match( '/([0-9]*)([a-z])/i', $leaseTime, $arrRangeLeaseTime ); + if ($leaseTime === 'infinite') { + $infiniteselected = ' selected="selected"'; + } else { + switch( $arrRangeLeaseTime[2] ) { + case 'h': + $hselected = ' selected="selected"'; + break; + case 'm': + $mselected = ' selected="selected"'; + break; + case 'd': + $dselected = ' selected="selected"'; + break; + } } - ?> +?>