From abdfe2cf2991b5fca0d31d1ae417281946865fee Mon Sep 17 00:00:00 2001
From: marknl <marknl@ispconfig3>
Date: Fri, 05 Aug 2011 14:39:26 -0400
Subject: [PATCH] http://bugtracker.ispconfig.org/index.php?do=details&task_id=681

---
 install/lib/installer_base.lib.php |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php
index 6f12df7..b41fb6c 100644
--- a/install/lib/installer_base.lib.php
+++ b/install/lib/installer_base.lib.php
@@ -523,9 +523,9 @@
 		$lines = explode("\n", $old_file); 
 		foreach ($lines as $line)
 		{
-			if (strlen($line) && substr($line, 0, 1) != '#')
+			if (trim($line) != '' && substr($line, 0, 1) != '#')
 			{
-				list($key, $value) = explode("=", $line);
+				@list($key, $value) = @explode("=", $line);
 				if (!empty($value))
 				{
 					$key = rtrim($key);
@@ -540,6 +540,7 @@
 			// create virtual_domains list
 			$domainAll = $this->db->queryAllRecords("SELECT domain FROM mail_mailinglist GROUP BY domain");
 			
+			if(is_array($domainAll)) {
 			foreach($domainAll as $domain)
 			{
 				if ($domainAll[0]['domain'] == $domain['domain'])
@@ -547,11 +548,13 @@
 				else
 					$virtual_domains .= ", '".$domain['domain']."'";
 			}
+			}
 		}
 		else
 			$virtual_domains = "' '";
 			
 		$content = str_replace('{hostname}', $conf['hostname'], $content);
+		if(!isset($old_options['DEFAULT_SERVER_LANGUAGE'])) $old_options['DEFAULT_SERVER_LANGUAGE'] = '';
 		$content = str_replace('{default_language}', $old_options['DEFAULT_SERVER_LANGUAGE'], $content);
 		$content = str_replace('{virtual_domains}', $virtual_domains, $content);
 

--
Gitblit v1.9.1