diff options
-rw-r--r-- | phpBB/install/database_update.php | 53 | ||||
-rw-r--r-- | phpBB/language/en/install.php | 1 |
2 files changed, 29 insertions, 25 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index d7398ea953..249b0a8f69 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -11,7 +11,7 @@ $updates_to_version = '3.0.6-dev'; // Enter any version to update from to test updates. The version within the db will not be updated. -$debug_from_version = '3.0.5'; +$debug_from_version = false; // Which oldest version does this updater supports? $oldest_from_version = '3.0.0'; @@ -249,28 +249,25 @@ if ($db->sql_layer == 'mysql' || $db->sql_layer == 'mysql4' || $db->sql_layer == echo '<h1>' . $lang['ERROR'] . '</h1><br />'; echo '<p>' . sprintf($lang['MYSQL_SCHEMA_UPDATE_REQUIRED'], $config['dbms_version'], $db->sql_server_info(true)) . '</p>'; -?> - </div> - </div> - <span class="corners-bottom"><span></span></span> - </div> - </div> - </div> - <div id="page-footer"> - Powered by <a href="http://www.phpbb.com/">phpBB</a> © 2000, 2002, 2005, 2007 phpBB Group - </div> -</div> - -</body> -</html> -<?php + _print_footer(); exit_handler(); exit; } } +// Now check if the user wants to update from a version we no longer support updates from +if (version_compare($current_version, $oldest_from_version, '<')) +{ + echo '<br /><br /><h1>' . $lang['ERROR'] . '</h1><br />'; + echo '<p>' . sprintf($lang['DB_UPDATE_NOT_SUPPORTED'], $oldest_from_version, $current_version) . '</p>'; + + _print_footer(); + exit_handler(); + exit; +} + // If the latest version and the current version are 'unequal', we will update the version_update_from, else we do not update anything. if ($inline_update) { @@ -455,8 +452,21 @@ add_log('admin', 'LOG_UPDATE_DATABASE', $orig_version, $updates_to_version); // Now we purge the session table as well as all cache files $cache->purge(); -?> +_print_footer(); + +garbage_collection(); + +if (function_exists('exit_handler')) +{ + exit_handler(); +} +/** +* Print out footer +*/ +function _print_footer() +{ + echo <<<EOF </div> </div> <span class="corners-bottom"><span></span></span> @@ -471,14 +481,7 @@ $cache->purge(); </body> </html> - -<?php - -garbage_collection(); - -if (function_exists('exit_handler')) -{ - exit_handler(); +EOF; } /** diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index 8e48dfbb36..bc2dfd6e16 100644 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -133,6 +133,7 @@ $lang = array_merge($lang, array( 'DB_PASSWORD' => 'Database password', 'DB_PORT' => 'Database server port', 'DB_PORT_EXPLAIN' => 'Leave this blank unless you know the server operates on a non-standard port.', + 'DB_UPDATE_NOT_SUPPORTED' => 'Sorry, but you are not able to update your phpBB database with this script. This update script updates the phpBB database from at least version ā%1$sā, but your version is ā%2$sā. Please try to update to an older version of phpBB first or post within our support forums to get more help.', 'DB_USERNAME' => 'Database username', 'DB_TEST' => 'Test connection', 'DEFAULT_LANG' => 'Default board language', |