Project

General

Profile

« Previous | Next » 

Revision acfbc960

Added by NewEraCracker about 9 years ago

Protect package_reinstall_all()

If one restores a config.xml without packages, there will be a warning about invalid argument supplied for foreach(). This commit fixes the problem.

(cherry picked from commit 5eda5816d8a7bd05730c70e44493815079925b48)

View differences:

src/etc/inc/pkg-utils.inc
1030 1030
		    FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
1031 1031
		unlink_if_exists("{$g['cf_conf_path']}/packages_to_reinstall_after_upgrade.txt");
1032 1032
	} else {
1033
		if (!isset($config['installedpackages']['package']) || !is_array($config['installedpackages']['package'])) {
1034
			return true;
1035
		}
1033 1036
		$package_list = array();
1034 1037
		foreach ($config['installedpackages']['package'] as $package) {
1035 1038
			$package_list[] = get_package_internal_name($package);

Also available in: Unified diff