aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install/database_update.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2010-03-02 01:05:37 +0100
committerNils Adermann <naderman@naderman.de>2010-03-02 01:05:37 +0100
commit2ba97da524f73f3a7244cd68b7f3daee7a1933a6 (patch)
tree2e01d3c01b99ebc51d1495c9de991690b6ed9ff5 /phpBB/install/database_update.php
parentaa4495b8ad0cf90c2b3f655441ccfee49701282d (diff)
parent7ecd17a99310df2fecea2967ec6f97bb6b63a2e3 (diff)
downloadforums-2ba97da524f73f3a7244cd68b7f3daee7a1933a6.tar
forums-2ba97da524f73f3a7244cd68b7f3daee7a1933a6.tar.gz
forums-2ba97da524f73f3a7244cd68b7f3daee7a1933a6.tar.bz2
forums-2ba97da524f73f3a7244cd68b7f3daee7a1933a6.tar.xz
forums-2ba97da524f73f3a7244cd68b7f3daee7a1933a6.zip
Merge commit 'release-3.0.0'
Diffstat (limited to 'phpBB/install/database_update.php')
-rw-r--r--phpBB/install/database_update.php26
1 files changed, 22 insertions, 4 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 0145c2746a..fc9ce65dac 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -8,7 +8,7 @@
*
*/
-$updates_to_version = '3.0.RC8';
+$updates_to_version = '3.0.0';
// Return if we "just include it" to find out for which version the database update is responsuble for
if (defined('IN_PHPBB') && defined('IN_INSTALL'))
@@ -463,6 +463,16 @@ $database_update_info = array(
),
),
),
+ // Changes from 3.0.RC8 to the next version
+ '3.0.RC8' => array(
+ // Change the following columns
+ 'change_columns' => array(
+ USERS_TABLE => array(
+ 'user_new_privmsg' => array('INT:4', 0),
+ 'user_unread_privmsg' => array('INT:4', 0),
+ ),
+ ),
+ ),
);
// Determine mapping database type
@@ -571,7 +581,7 @@ else
// Checks/Operations that have to be completed prior to starting the update itself
$exit = false;
-if (version_compare($current_version, '3.0.RC4', '<='))
+if (version_compare($current_version, '3.0.RC8', '<='))
{
// Define missing language entries...
if (!isset($lang['CLEANING_USERNAMES']))
@@ -715,9 +725,13 @@ if (version_compare($current_version, '3.0.RC4', '<='))
// duplicates might be created. Since the column has to be unique such usernames
// must not exist. We need identify them and let the admin decide what to do
// about them.
+ // After RC8 this was changed again, but this time only usernames containing spaces
+ // are affected.
+ $sql_where = (version_compare($current_version, '3.0.RC4', '<=')) ? '' : "WHERE username_clean LIKE '% %'";
$sql = 'SELECT user_id, username, username_clean
- FROM ' . USERS_TABLE . '
- ORDER BY user_id ASC';
+ FROM ' . USERS_TABLE . "
+ $sql_where
+ ORDER BY user_id ASC";
$result = $db->sql_query($sql);
$colliding_users = $found_names = array();
@@ -1635,6 +1649,8 @@ $cache->purge();
<?php
+garbage_collection();
+
if (function_exists('exit_handler'))
{
exit_handler();
@@ -2765,6 +2781,8 @@ function utf8_new_clean_string($text)
// Other control characters
$text = preg_replace('#(?:[\x00-\x1F\x7F]+|(?:\xC2[\x80-\x9F])+)#', '', $text);
+ $text = preg_replace('# {2,}#', ' ', $text);
+
// we can use trim here as all the other space characters should have been turned
// into normal ASCII spaces by now
return trim($text);