From c2a1c72d5ed549c8a8e7f77580823c4437dfce15 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Mon, 07 Nov 2011 15:50:49 -0500
Subject: [PATCH] Added a version check to ensure that this update is used only for ISPConfig > 3.0.3

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

diff --git a/install/lib/update.lib.php b/install/lib/update.lib.php
index d95bbf8..3bad852 100644
--- a/install/lib/update.lib.php
+++ b/install/lib/update.lib.php
@@ -113,7 +113,7 @@
 	$ini_array = ini_to_array(stripslashes($tmp['config']));
 	$current_db_version = (isset($tmp['dbversion']))?intval($tmp['dbversion']):0;
 
-	if(count($ini_array) == 0) die('Unable to read server configuration from database.');
+	if(!is_array($ini_array) or count($ini_array) == 0) die('Unable to read server configuration from database.');
 
 	$conf['services']['mail'] = ($tmp['mail_server'] == 1)?true:false;
 	$conf['services']['web'] = ($tmp['web_server'] == 1)?true:false;
diff --git a/install/update.php b/install/update.php
index 74764ce..e7f9d07 100644
--- a/install/update.php
+++ b/install/update.php
@@ -78,6 +78,9 @@
 
 if($dist['id'] == '') die('Linux distribution or version not recognized.');
 
+//** Check version
+if(compare_ispconfig_version('3.0.3',ISPC_APP_VERSION) < 0) die('This updater is for ISPConfig versions > 3.0.3.0. Please Update to ISPConfig 3.0.3.3 first before you update to the current ISPConfig version.');
+
 //** Include the distribution-specific installer class library and configuration
 if(is_file('dist/lib/'.$dist['baseid'].'.lib.php')) include_once('dist/lib/'.$dist['baseid'].'.lib.php');
 include_once('dist/lib/'.$dist['id'].'.lib.php');

--
Gitblit v1.9.1