diff options
Diffstat (limited to 'phpBB/install/install_install.php')
-rw-r--r-- | phpBB/install/install_install.php | 52 |
1 files changed, 13 insertions, 39 deletions
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 9fe0c8aed5..e18ed43778 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -1235,8 +1235,7 @@ class install_install extends module $current_time = time(); - $user_ip = (!empty($_SERVER['REMOTE_ADDR'])) ? htmlspecialchars($_SERVER['REMOTE_ADDR']) : ''; - $user_ip = (stripos($user_ip, '::ffff:') === 0) ? substr($user_ip, 7) : $user_ip; + $user_ip = (!empty($_SERVER['REMOTE_ADDR'])) ? phpbb_ip_normalise($_SERVER['REMOTE_ADDR']) : ''; if ($data['script_path'] !== '/') { @@ -1461,17 +1460,10 @@ class install_install extends module include_once($phpbb_root_path . 'includes/constants.' . $phpEx); include_once($phpbb_root_path . 'includes/search/fulltext_native.' . $phpEx); - // Fill the config array - it is needed by those functions we call - $sql = 'SELECT * - FROM ' . CONFIG_TABLE; - $result = $db->sql_query($sql); - - $config = array(); - while ($row = $db->sql_fetchrow($result)) - { - $config[$row['config_name']] = $row['config_value']; - } - $db->sql_freeresult($result); + // We need to fill the config to let internal functions correctly work + $config = new phpbb_config_db($db, new phpbb_cache_driver_null, CONFIG_TABLE); + set_config(null, null, null, $config); + set_config_count(null, null, null, $config); $error = false; $search = new fulltext_native($error); @@ -1831,17 +1823,10 @@ class install_install extends module // Obtain any submitted data $data = $this->get_submitted_data(); - // Fill the config array - it is needed by those functions we call - $sql = 'SELECT * - FROM ' . CONFIG_TABLE; - $result = $db->sql_query($sql); - - $config = array(); - while ($row = $db->sql_fetchrow($result)) - { - $config[$row['config_name']] = $row['config_value']; - } - $db->sql_freeresult($result); + // We need to fill the config to let internal functions correctly work + $config = new phpbb_config_db($db, new phpbb_cache_driver_null, CONFIG_TABLE); + set_config(null, null, null, $config); + set_config_count(null, null, null, $config); $sql = 'SELECT group_id FROM ' . GROUPS_TABLE . " @@ -1908,19 +1893,10 @@ class install_install extends module $this->page_title = $lang['STAGE_FINAL']; - // Obtain any submitted data - $data = $this->get_submitted_data(); - - $sql = 'SELECT * - FROM ' . CONFIG_TABLE; - $result = $db->sql_query($sql); - - $config = array(); - while ($row = $db->sql_fetchrow($result)) - { - $config[$row['config_name']] = $row['config_value']; - } - $db->sql_freeresult($result); + // We need to fill the config to let internal functions correctly work + $config = new phpbb_config_db($db, new phpbb_cache_driver_null, CONFIG_TABLE); + set_config(null, null, null, $config); + set_config_count(null, null, null, $config); $user->session_begin(); $auth->login($data['admin_name'], $data['admin_pass1'], false, true, true); @@ -2242,5 +2218,3 @@ class install_install extends module ), ); } - -?>
\ No newline at end of file |