diff --git a/phpBB/includes/acp/acp_search.php b/phpBB/includes/acp/acp_search.php index f03439d265..a2f3b97186 100644 --- a/phpBB/includes/acp/acp_search.php +++ b/phpBB/includes/acp/acp_search.php @@ -274,8 +274,6 @@ class acp_search $this->max_post_id = $this->get_max_post_id(); - $post_counter = (isset($this->state[2])) ? $this->state[2] : 0; - $this->state[2] = &$post_counter; $this->save_state(); switch ($action) diff --git a/phpBB/phpbb/search/backend/fulltext_native.php b/phpBB/phpbb/search/backend/fulltext_native.php index 7341c77ba1..538498f3b6 100644 --- a/phpBB/phpbb/search/backend/fulltext_native.php +++ b/phpBB/phpbb/search/backend/fulltext_native.php @@ -1687,7 +1687,8 @@ class fulltext_native extends base implements search_backend_interface $starttime = microtime(true); $row_count = 0; - $post_counter = $acp_module->state[2]; + + $post_counter = &$acp_module->state[2]; while (still_on_time() && $post_counter <= $acp_module->max_post_id) { $sql = 'SELECT post_id, post_subject, post_text, poster_id, forum_id @@ -1723,6 +1724,7 @@ class fulltext_native extends base implements search_backend_interface $post_counter += $acp_module->batch_size; } + // save the current state $acp_module->save_state();