diff options
-rw-r--r-- | phpBB/includes/constants.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions_convert.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions_user.php | 8 | ||||
-rw-r--r-- | phpBB/install/convertors/convert_phpbb20.php | 6 | ||||
-rw-r--r-- | phpBB/install/convertors/functions_phpbb20.php | 2 | ||||
-rw-r--r-- | phpBB/install/database_update.php | 10 |
6 files changed, 23 insertions, 7 deletions
diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index 8257f8a48e..eb4eb77f22 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -173,7 +173,7 @@ define('FIELD_DATE', 6); // Additional constants -define('VOTE_CONVERTED', 9999); +define('VOTE_CONVERTED', 127); // Table names define('ACL_GROUPS_TABLE', $table_prefix . 'acl_groups'); diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index ed35be3db7..477dd787a1 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -1282,7 +1282,7 @@ function restore_config($schema) // Most are... if (is_string($config_value)) { - $config_value = utf8_htmlspecialchars($config_value); + $config_value = truncate_string(utf8_htmlspecialchars($config_value), 255, false); } set_config($config_name, $config_value); diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 8782460ecf..55cf45505e 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -143,7 +143,11 @@ function user_update_name($old_name, $new_name) } /** -* Add User +* Adds an user +* +* @param mixed $user_row An array containing the following keys (and the appropriate values): username, group_id (the group to place the user in), user_email and the user_type(usually 0). Additional entries not overridden by defaults will be forwarded. +* @param string $cp_data custom profile fields, see custom_profile::build_insert_sql_array +* @return: the new user's ID. */ function user_add($user_row, $cp_data = false) { @@ -281,7 +285,7 @@ function user_add($user_row, $cp_data = false) $sql = 'SELECT group_colour FROM ' . GROUPS_TABLE . ' - WHERE group_id = ' . $user_row['group_id']; + WHERE group_id = ' . (int) $user_row['group_id']; $result = $db->sql_query_limit($sql, 1); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index 16b500d8d5..4fe59d5a0a 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -482,14 +482,16 @@ if (!$get_info) array('topic_moved_id', 0, ''), array('topic_type', 'topics.topic_type', 'phpbb_convert_topic_type'), array('topic_first_post_id', 'topics.topic_first_post_id', ''), - + array('topic_last_view_time', 'posts.post_time', ''), array('poll_title', 'vote_desc.vote_text', array('function1' => 'null_to_str', 'function2' => 'phpbb_set_encoding', 'function3' => 'utf8_htmlspecialchars')), array('poll_start', 'vote_desc.vote_start', 'null_to_zero'), array('poll_length', 'vote_desc.vote_length', 'null_to_zero'), array('poll_max_options', 1, ''), array('poll_vote_change', 0, ''), - 'left_join' => 'topics LEFT JOIN vote_desc ON topics.topic_id = vote_desc.topic_id AND topics.topic_vote = 1', + 'left_join' => array ( 'topics LEFT JOIN vote_desc ON topics.topic_id = vote_desc.topic_id AND topics.topic_vote = 1', + 'topics LEFT JOIN posts ON topics.topic_last_post_id = posts.post_id', + ), 'where' => 'topics.topic_moved_id = 0', ), diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index 1f62d80852..c4d421efee 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -455,7 +455,7 @@ function phpbb_get_birthday($birthday = '') { $birthday = (int) $birthday; - if (!$birthday || $birthday == 999999 || $birthday < 0) + if (!$birthday || $birthday == 999999 || ((version_compare(PHP_VERSION, '5.1.0') < 0) && $birthday < 0)) { return ' 0- 0- 0'; } diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index a4d6c46695..899384fb41 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1559,6 +1559,16 @@ if (version_compare($current_version, '3.0.RC5', '<=')) $no_updates = false; } + +if (version_compare($current_version, '3.0.0', '<=')) +{ + $sql = 'UPDATE ' . TOPICS_TABLE . " + SET topic_last_view_time = topic_last_post_time + WHERE topic_last_view_time = 0"; + _sql($sql, $errored, $error_ary); + + // TODO: remove all form token min times +} _write_result($no_updates, $errored, $error_ary); $error_ary = array(); |