From 489ffb0376edee1927ed72400e6486dc0c619db6 Mon Sep 17 00:00:00 2001 From: sullrich Date: Thu, 10 Dec 2009 16:59:41 -0500 Subject: Do not foreach if item does not exist. Add minimal ports --- config/portsentry/portsentry.inc | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'config/portsentry') diff --git a/config/portsentry/portsentry.inc b/config/portsentry/portsentry.inc index 72ba51ab..b0a750d8 100644 --- a/config/portsentry/portsentry.inc +++ b/config/portsentry/portsentry.inc @@ -30,13 +30,17 @@ function portsentry_custom_php_install_command() { $scantrigger = "0"; $isfirst = true; - $ports = ""; - foreach($config['installedpackages']['portsentry']['config'][0]['row'] as $ps) { - if(!$isfirst) - $ports .= ","; - if($ps['listenport']) - $ports .= $ps['listenport']; - $isfirst = false; + + $ports = "1,11,15,110,111,143,540,635,1080,1524,2000,12345,12346,20034,32771,32772,32773,32774,49724,54320"; + if($config['installedpackages']['portsentry']['config'][0]['row']) { + $ports = ""; + foreach($config['installedpackages']['portsentry']['config'][0]['row'] as $ps) { + if(!$isfirst) + $ports .= ","; + if($ps['listenport']) + $ports .= $ps['listenport']; + $isfirst = false; + } } $tcp_ports = $ports; $udp_ports = $ports; -- cgit v1.2.3