diff --git a/phpBB/includes/db/db_tools.php b/phpBB/includes/db/db_tools.php index e57063534e..c246f85cb9 100644 --- a/phpBB/includes/db/db_tools.php +++ b/phpBB/includes/db/db_tools.php @@ -424,6 +424,25 @@ class phpbb_db_tools */ public function sql_insert_data($schema_data, &$data) { + // Go through the columns and define our type and column name for each column + $keys = $types = array(); + + foreach ($schema_data['columns'] as $column) + { + if (strpos($column, ':') === false) + { + $types[] = false; + $keys[] = $column; + continue; + } + + list($type, $column) = explode(':', $column, 2); + $types[] = $type; + $keys[] = $column; + } + + $size = sizeof($keys); + // Go through the data array... foreach ($schema_data['data'] as $key => $row) { @@ -432,12 +451,19 @@ class phpbb_db_tools { // Special case... $row[$_key] = $this->_sql_get_special_row($value, $data); + + if ($types[$_key] === false) + { + settype($row[$_key], gettype($row[$_key])); + } + else + { + settype($row[$_key], $types[$_key]); + } } // Build SQL array for INSERT - $sql_ary = array_combine(array_values($schema_data['columns']), $row); - $sql = 'INSERT INTO ' . $schema_data['table'] . ' ' . $this->db->sql_build_array('INSERT', $sql_ary); - + $sql = 'INSERT INTO ' . $schema_data['table'] . ' ' . $this->db->sql_build_array('INSERT', array_combine($keys, $row)); $this->db->sql_query($sql); if (!empty($schema_data['store_auto_increment'])) diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index eb61be1f46..204634f6b0 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -130,6 +130,8 @@ class install_install extends module include PHPBB_ROOT_PATH . 'common.' . PHP_EXT; + phpbb::$acm->purge(); + $this->build_search_index($mode, $sub); $this->add_modules($mode, $sub); $this->add_language($mode, $sub); diff --git a/phpBB/install/schemas/schema_data.php b/phpBB/install/schemas/schema_data.php index 93502b28a8..ff14ef26fa 100644 --- a/phpBB/install/schemas/schema_data.php +++ b/phpBB/install/schemas/schema_data.php @@ -47,7 +47,7 @@ $schema_data[] = array( // phpbb_config $schema_data[] = array( 'table' => 'phpbb_config', - 'columns' => array('config_name', 'config_value'), + 'columns' => array('string:config_name', 'string:config_value'), 'data' => array( array('active_sessions', '0'), array('allow_attachments', '1'), @@ -311,7 +311,7 @@ $schema_data[] = array( // Dynamic config values $schema_data[] = array( 'table' => 'phpbb_config', - 'columns' => array('config_name', 'config_value', 'is_dynamic'), + 'columns' => array('string:config_name', 'string:config_value', 'is_dynamic'), 'data' => array( array('cache_last_gc', '0', 1), array('cron_lock', '0', 1),