diff options
author | D. V. Serg <dvserg@pfsense.org> | 2008-02-21 13:41:53 +0000 |
---|---|---|
committer | D. V. Serg <dvserg@pfsense.org> | 2008-02-21 13:41:53 +0000 |
commit | c5058da9d8aca4c2dbd0cea7e31f1fc65403c8f0 (patch) | |
tree | 6f3851740932e24be23c7b3be9ebd2d1a9e233e6 /packages/squidGuard/squidguard.inc | |
parent | 8e44d54f258a7063fb733dd636963b382a325762 (diff) | |
download | pfsense-packages-c5058da9d8aca4c2dbd0cea7e31f1fc65403c8f0.tar.gz pfsense-packages-c5058da9d8aca4c2dbd0cea7e31f1fc65403c8f0.tar.bz2 pfsense-packages-c5058da9d8aca4c2dbd0cea7e31f1fc65403c8f0.zip |
Fix arrays bug 1
Diffstat (limited to 'packages/squidGuard/squidguard.inc')
-rw-r--r-- | packages/squidGuard/squidguard.inc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/packages/squidGuard/squidguard.inc b/packages/squidGuard/squidguard.inc index d31e7cad..2e882182 100644 --- a/packages/squidGuard/squidguard.inc +++ b/packages/squidGuard/squidguard.inc @@ -1299,15 +1299,17 @@ function convert_pfxml_to_sgxml_rewrite($pfconfig) { if (is_array($pfxml)) { foreach($pfxml as $pfx) { $sgx = array(); - $sgx[FLD_NAME] = $pfx['name']; - $sgx[FLD_DESCRIPTION] = $pfx['description']; - $sgx[FLD_LOG] = $pfx[FLD_ENABLELOG]; + $sgx[FLD_NAME] = $pfx['name']; + $sgx[FLD_DESCRIPTION] = $pfx['description']; + $sgx[FLD_LOG] = $pfx[FLD_ENABLELOG]; - foreach($pfx['row'] as $pfx_row) { + if (is_array($pfx['row'])) { + foreach($pfx['row'] as $pfx_row) { $sgx_row = array(); $sgx_row[FLD_TARGETURL] = $pfx_row['targeturl']; $sgx_row[FLD_REPLACETO] = $pfx_row['replaceto']; $sgx[FLD_ITEM][] = $sgx_row; + } } $sgxml[FLD_ITEM][] = $sgx; @@ -1330,13 +1332,15 @@ function convert_pfxml_to_sgxml_time($pfconfig) { $sgx[FLD_NAME] = $pfx[FLD_NAME]; $sgx[FLD_DESCRIPTION] = $pfx[FLD_DESCRIPTION]; - foreach($pfx['row'] as $pfx_row) { + if (is_array($pfx['row'])) { + foreach($pfx['row'] as $pfx_row) { $sgx_row = array(); $sgx_row[FLD_TIMETYPE] = $pfx_row[FLD_TIMETYPE]; $sgx_row[FLD_TIMEDAYS] = $pfx_row[FLD_TIMEDAYS]; $sgx_row[FLD_DATERANGE] = $pfx_row[FLD_DATERANGE]; $sgx_row[FLD_TIMERANGE] = $pfx_row[FLD_TIMERANGE]; $sgx[FLD_ITEM][] = $sgx_row; + } } $sgxml[FLD_ITEM][] = $sgx; |