From 5f221a9599ce7998a5fc0ecd0422f2529928f078 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Thu, 22 Sep 2011 12:32:22 +0000
Subject: [PATCH] Fixed bugs in updater.

---
 install/autoupdate.php     | 1 +
 install/lib/update.lib.php | 3 ++-
 install/update.php         | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/install/autoupdate.php b/install/autoupdate.php
index b77ff49b38..a9863cee2d 100644
--- a/install/autoupdate.php
+++ b/install/autoupdate.php
@@ -156,6 +156,7 @@ prepareDBDump();
 
 //* initialize the database
 $inst->db = new db();
+$inst->db->dbName = $conf["mysql"]["database"];
 
 /*
  * The next line is a bit tricky!
diff --git a/install/lib/update.lib.php b/install/lib/update.lib.php
index 7d2464b07e..d95bbf8043 100644
--- a/install/lib/update.lib.php
+++ b/install/lib/update.lib.php
@@ -286,7 +286,8 @@ function updateDbAndIni() {
 	}
 
 	$new_ini = array_to_ini($tpl_ini_array);
-	$inst->db->query("UPDATE server SET config = '".mysql_real_escape_string($new_ini)."' WHERE server_id = ".$conf['server_id']);
+	$sql = "UPDATE server SET config = '".mysql_real_escape_string($new_ini)."' WHERE server_id = ".$conf['server_id'];
+	$inst->db->query($sql);
 	unset($old_ini_array);
 	unset($tpl_ini_array);
 	unset($new_ini);
diff --git a/install/update.php b/install/update.php
index f88883398f..54dfd271d7 100644
--- a/install/update.php
+++ b/install/update.php
@@ -152,6 +152,7 @@ prepareDBDump();
 
 //* initialize the database
 $inst->db = new db();
+$inst->db->dbName = $conf["mysql"]["database"];
 
 //* initialize the master DB, if we have a multiserver setup
 if($conf['mysql']['master_slave_setup'] == 'y') {
-- 
GitLab