aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-06-22 18:44:20 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-06-22 18:44:20 +0000
commitb30008ecd12fceb33c1af7d5af02b8f9737cdbb2 (patch)
tree1e15640516cc82ccd998ac4c4cc73de3293e26eb /packages
parent09ec35a52f490b5251b0448a5f02a18642a0759c (diff)
downloadpfsense-packages-b30008ecd12fceb33c1af7d5af02b8f9737cdbb2.tar.gz
pfsense-packages-b30008ecd12fceb33c1af7d5af02b8f9737cdbb2.tar.bz2
pfsense-packages-b30008ecd12fceb33c1af7d5af02b8f9737cdbb2.zip
Do not foreach through non-existant arrays
Diffstat (limited to 'packages')
-rw-r--r--packages/spamd.xml16
1 files changed, 9 insertions, 7 deletions
diff --git a/packages/spamd.xml b/packages/spamd.xml
index 0bb60750..ff0a6f69 100644
--- a/packages/spamd.xml
+++ b/packages/spamd.xml
@@ -120,13 +120,15 @@
fwrite($fd, "\t:file=/var/mail/whitelist.txt\n");
/* loop through each item and write out its configuration */
fwrite($fd, "\n# begin of user created entries\n");
- foreach($config['installedpackages']['spamd']['config'] as $spamd) {
- fwrite($fd, rtrim($spamd['providername']) . ":\\\n");
- fwrite($fd, "\t:" . rtrim($spamd['providertype']) . ":\\\n");
- fwrite($fd, "\t:msg=\"" . rtrim($spamd['rejectmessage']) . "\":\\\n");
- fwrite($fd, "\t:method=" . rtrim($spamd['providermethod']) . ":\\\n");
- fwrite($fd, "\t:" . rtrim($spamd['providermethod']) . ":\\\n");
- fwrite($fd, "\t:file=" . rtrim($spamd['providerurl']) . ":\n\n");
+ if($config['installedpackages']['spamd']['config']) {
+ foreach($config['installedpackages']['spamd']['config'] as $spamd) {
+ fwrite($fd, rtrim($spamd['providername']) . ":\\\n");
+ fwrite($fd, "\t:" . rtrim($spamd['providertype']) . ":\\\n");
+ fwrite($fd, "\t:msg=\"" . rtrim($spamd['rejectmessage']) . "\":\\\n");
+ fwrite($fd, "\t:method=" . rtrim($spamd['providermethod']) . ":\\\n");
+ fwrite($fd, "\t:" . rtrim($spamd['providermethod']) . ":\\\n");
+ fwrite($fd, "\t:file=" . rtrim($spamd['providerurl']) . ":\n\n");
+ }
}
fclose($fd);
$fd = fopen("/var/mail/whitelist.txt","w");