diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-04-20 19:01:11 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-04-20 19:01:11 +0000 |
commit | 059249e12b42d90c9b271f6656720e6848066112 (patch) | |
tree | bf11051f9b1ac22ff2a6a2db9e63fae8eb1d6bf1 /usr/local/www | |
parent | 3bfb54ac6ac575843fe6dae0f6fc1d034b40aef9 (diff) | |
download | pfsense-059249e12b42d90c9b271f6656720e6848066112.zip pfsense-059249e12b42d90c9b271f6656720e6848066112.tar.gz |
Do not traverse arrays if they are not an array
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/pkg_mgr_install.php | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/usr/local/www/pkg_mgr_install.php b/usr/local/www/pkg_mgr_install.php index aa710e7..0166e01 100755 --- a/usr/local/www/pkg_mgr_install.php +++ b/usr/local/www/pkg_mgr_install.php @@ -141,23 +141,25 @@ if($_GET['mode'] == "reinstallall") { */ $output_static = ""; $counter = 0; - foreach($pkg_config['packages']['package'] as $available_package) { - foreach($config['installedpackages']['package'] as $package) { - if($package['name'] == $available_package['name']) { - array_push($packages_to_install, $counter); - $output_static .= "Adding " . $package['name'] . " to installation array.\n"; - update_output_window($output_static); - fwrite($fd_log, "Adding (" . $counter . ") " . $package['name'] . " to package installation array.\n" . $status); - } - } - $counter++; - } + if(is_array($pkg_config['packages']['package'])) + foreach($pkg_config['packages']['package'] as $available_package) { + if(is_array($config['installedpackages']['package'])) + foreach($config['installedpackages']['package'] as $package) { + if($package['name'] == $available_package['name']) { + array_push($packages_to_install, $counter); + $output_static .= "Adding " . $package['name'] . " to installation array.\n"; + update_output_window($output_static); + fwrite($fd_log, "Adding (" . $counter . ") " . $package['name'] . " to package installation array.\n" . $status); + } + } + $counter++; + } } else { - /* - * Push the desired package id onto the install packages array - */ - fwrite($fd_log, "Single package installation started.\n"); - array_push($packages_to_install, $_GET['id']); + /* + * Push the desired package id onto the install packages array + */ + fwrite($fd_log, "Single package installation started.\n"); + array_push($packages_to_install, $_GET['id']); } /* |