aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2008-02-03 01:12:17 +0000
committerScott Ullrich <sullrich@pfsense.org>2008-02-03 01:12:17 +0000
commit21e8d5e7afe561a698f6e3e6f38c828fecb6b99f (patch)
treedd0eb2eef0d93468d1edc1a98d190b3471ee1047
parent96acb6e6c1a31ef688048d4c730c29dd860d62da (diff)
downloadpfsense-packages-21e8d5e7afe561a698f6e3e6f38c828fecb6b99f.tar.gz
pfsense-packages-21e8d5e7afe561a698f6e3e6f38c828fecb6b99f.tar.bz2
pfsense-packages-21e8d5e7afe561a698f6e3e6f38c828fecb6b99f.zip
Before creating a PHP pointer to an array, make sure the section exists.
Otherwise this will create a <blank></blank> or <blank/> entry. This BUG / practice plagues many packages. Glad we finally found the culprit.
-rw-r--r--packages/openbgpd/openbgpd.inc18
1 files changed, 12 insertions, 6 deletions
diff --git a/packages/openbgpd/openbgpd.inc b/packages/openbgpd/openbgpd.inc
index 70b725c6..8e64c683 100644
--- a/packages/openbgpd/openbgpd.inc
+++ b/packages/openbgpd/openbgpd.inc
@@ -34,12 +34,14 @@ function openbgpd_install_conf() {
conf_mount_rw();
- if($config['installedpackages']['openbgpd']['config']) {
+ if($config['installedpackages']['openbgpd']['config'])
$openbgpd_conf = &$config['installedpackages']['openbgpd']['config'][0];
- $openbgpd_rows = &$config['installedpackages']['openbgpd']['config'][0]['row'];
+ if($config['installedpackages']['openbgpd']['config'][0]['row'])
+ $openbgpd_rows = &$config['installedpackages']['openbgpd']['config'][0]['row'];
+ if($config['installedpackages']['openbgpdgroups']['config'])
$openbgpd_groups = &$config['installedpackages']['openbgpdgroups']['config'];
+ if($config['installedpackages']['openbgpdneighbors']['config'])
$openbgpd_neighbors = &$config['installedpackages']['openbgpdneighbors']['config'];
- }
$fd = fopen("/usr/local/etc/bgpd.conf", "w");
@@ -152,12 +154,16 @@ function deinstall_openbgpd() {
function check_group_usage($groupname) {
global $config, $g;
- if($config['installedpackages']['openbgpd']['config']) {
+
+ if($config['installedpackages']['openbgpd']['config'])
$openbgpd_conf = &$config['installedpackages']['openbgpd']['config'][0];
- $openbgpd_rows = &$config['installedpackages']['openbgpd']['config'][0]['row'];
+ if($config['installedpackages']['openbgpd']['config'][0]['row'])
+ $openbgpd_rows = &$config['installedpackages']['openbgpd']['config'][0]['row'];
+ if($config['installedpackages']['openbgpdgroups']['config'])
$openbgpd_groups = &$config['installedpackages']['openbgpdgroups']['config'];
+ if($config['installedpackages']['openbgpdneighbors']['config'])
$openbgpd_neighbors = &$config['installedpackages']['openbgpdneighbors']['config'];
- }
+
if(is_array($openbgpd_groups)) {
foreach($openbgpd_groups as $group) {
foreach($openbgpd_neighbors as $neighbor) {