Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1524)
+++ branches/2.8.x/CHANGELOG	(revision 1525)
@@ -13,6 +13,8 @@
 =========================== add small Features 2.8.2 ==========================
 
 ----------------------------------- Fixes 2.8.2 --------------------------------
+15 Nov-2011 Build 1525 Dietmar Woellbrink (Luisehahne)
+# fix versions compare upgrade from WB version 2.7
 13 Nov-2011 Build 1524 Dietmar Woellbrink (Luisehahne)
 ! fix secureform was not updated
 13 Nov-2011 Build 1523 Dietmar Woellbrink (Luisehahne)
Index: branches/2.8.x/wb/upgrade-script.php
===================================================================
--- branches/2.8.x/wb/upgrade-script.php	(revision 1524)
+++ branches/2.8.x/wb/upgrade-script.php	(revision 1525)
@@ -4,7 +4,6 @@
  * @category        backend
  * @package         installation
  * @author          WebsiteBaker Project
- * @copyright       2004-2009, Ryan Djurovich
  * @copyright       2009-2011, Website Baker Org. e.V.
  * @link			http://www.websitebaker2.org/
  * @license         http://www.gnu.org/licenses/gpl.html
@@ -50,11 +49,7 @@
 $FAIL          = ' <span class="error">FAILED</span> ';
 $DEFAULT_THEME = 'wb_theme';
 
-$files2remove = array(
-
-			'[ADMIN]/preferences/details.php',
-			'[ADMIN]/preferences/email.php',
-			'[ADMIN]/preferences/password.php',
+$dir2remove = array(
 /*
 			'[TEMPLATE]/allcss/',
 			'[TEMPLATE]/blank/',
@@ -63,7 +58,15 @@
 */
 		 );
 
+$files2remove = array(
 
+			'[ADMIN]/preferences/details.php',
+			'[ADMIN]/preferences/email.php',
+			'[ADMIN]/preferences/password.php',
+
+		 );
+
+
 // analyze/check database tables
 function mysqlCheckTables( $dbName )
 {
@@ -196,8 +199,8 @@
 <img src="templates/wb_theme/images/logo.png" alt="WebsiteBaker Project" />
 <h1>WebsiteBaker Upgrade</h1>
 <?php
-	if( version_compare( WB_VERSION, '2.7.0', '<' )) {
-		status_msg('<strong>Warning:</strong><br />It is not possible to upgrade from WebsiteBaker Versions before 2.7.0.<br />For upgrading to version '.VERSION.' you must upgrade first to v.2.7.0 at least!!!', 'warning', 'div');
+	if( version_compare( WB_VERSION, '2.7', '<' )) {
+		status_msg('<strong>Warning:</strong><br />It is not possible to upgrade from WebsiteBaker Versions before 2.7.0.<br />For upgrading to version '.VERSION.' you must upgrade first to v.2.7 at least!!!', 'warning', 'div');
 		echo '<br /><br />';
 		echo "</div>
 		</body>
@@ -391,7 +394,7 @@
 echo "<br />Adding field redirect_type to mod_menu_link table<br />";
 db_add_field('redirect_type', 'mod_menu_link', "INT NOT NULL DEFAULT '302' AFTER `target_page_id`");
 
-if (version_compare(WB_VERSION, '2.8.0') < 0)
+if (version_compare(WB_VERSION, '2.8') < 0)
 {
     /**********************************************************
      *  - Update search no results database filed to create
@@ -560,12 +563,14 @@
 	$searches = array(
 		'[ADMIN]',
 		'[MEDIA]',
-		'[PAGES]'
+		'[PAGES]',
+		'[TEMPLATE]'
 	);
 	$replacements = array(
-		substr(ADMIN_PATH, strlen(WB_PATH)),
+		substr(ADMIN_PATH, strlen(WB_PATH)+1),
 		MEDIA_DIRECTORY,
-		PAGES_DIRECTORY
+		PAGES_DIRECTORY,
+		'/templates',
 	);
 
 	$msg = '';
@@ -588,10 +593,51 @@
 			    can not be removed automatically.<br /><br />Please delete them
 				using FTP and restart upgrade-script!<br /><br />'.$msg;
         status_msg($msg, 'error warning', 'div');
-		echo '<br /><br /></div></body></html>';
+		echo '<br /><br /><br /><br /></div></body></html>';
 		exit();
 	}
 /**********************************************************
+ * - check for deprecated / never needed files
+ */
+?>
+<h2>Step 4: Remove deprecated and old Templates</h2>
+<?php
+
+	$searches = array(
+		'[ADMIN]',
+		'[MEDIA]',
+		'[PAGES]',
+		'[TEMPLATE]'
+	);
+	$replacements = array(
+		substr(ADMIN_PATH, strlen(WB_PATH)+1),
+		MEDIA_DIRECTORY,
+		PAGES_DIRECTORY,
+		'/templates',
+	);
+
+	$msg = '';
+	foreach( $dir2remove as $dir )
+	{
+		$dir = str_replace($searches, $replacements, $dir);
+		$dir = WB_PATH.'/'.$dir;
+		if( is_dir( $dir ))
+		{ // try to delete dir
+			if(!rm_full_dir($dir))
+			{ // save in err-list, if failed
+				$msg .= $dir.'<br />';
+			}
+		}
+	}
+	if($msg != '')
+	{
+		$msg = 'Following directories are deprecated, outdated or a security risk and
+			    can not be removed automatically.<br /><br />Please delete them
+				using FTP!<br /><br />'.$msg;
+        status_msg($msg, 'error warning', 'div');
+		echo '<br /><br /><br /><br /></div>';
+	}
+/**********************************************************
  *  - Reload all addons
  */
 
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1524)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1525)
@@ -52,4 +52,4 @@
 
 // check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
 if(!defined('VERSION')) define('VERSION', '2.8.2');
-if(!defined('REVISION')) define('REVISION', '1524');
+if(!defined('REVISION')) define('REVISION', '1525');
