From ed4dbba27809f9272c7dcbc235730db96ac9fc7a Mon Sep 17 00:00:00 2001 From: Ante de Baas Date: Sun, 31 May 2020 20:46:27 +0200 Subject: [PATCH] also perform checks in Install class --- install/lib/class.FroxlorInstall.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/install/lib/class.FroxlorInstall.php b/install/lib/class.FroxlorInstall.php index cb833d90..2f4c8f95 100644 --- a/install/lib/class.FroxlorInstall.php +++ b/install/lib/class.FroxlorInstall.php @@ -1340,9 +1340,18 @@ class FroxlorInstall // post if (! empty($_POST['distribution'])) { $this->_data['distribution'] = $_POST['distribution']; - } else { - $os_dist = parse_ini_file('/etc/os-release', false); - $os_version = explode('.',$os_dist['VERSION_ID'])[0]; + } else { + //set default os. + $os_dist = array('ID' => 'buster'); + $os_version = array('0' => '10'); + + //read os-release + if(file_exists('/etc/os-release')) { + $os_dist = parse_ini_file('/etc/os-release', false); + if(is_array($os_dist) && array_key_exists('ID', $os_dist) && array_key_exists('VERSION_ID', $os_dist)) { + $os_version = explode('.',$os_dist['VERSION_ID'])[0]; + } + } $distros = glob(\Froxlor\FileDir::makeCorrectDir(\Froxlor\Froxlor::getInstallDir() . '/lib/configfiles/') . '*.xml'); foreach ($distros as $_distribution) {