mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-03 15:27:42 +02:00
[ticket/17491] Consistently apply array_unique to search results
PHPBB-17491
This commit is contained in:
@@ -609,7 +609,6 @@ class fulltext_mysql extends \phpbb\search\base
|
|||||||
}
|
}
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
|
|
||||||
$id_ary = array_unique($id_ary);
|
|
||||||
// if the total result count is not cached yet, retrieve it from the db
|
// if the total result count is not cached yet, retrieve it from the db
|
||||||
if (!$result_count && count($id_ary))
|
if (!$result_count && count($id_ary))
|
||||||
{
|
{
|
||||||
@@ -635,9 +634,9 @@ class fulltext_mysql extends \phpbb\search\base
|
|||||||
$id_ary[] = (int) $row[$field];
|
$id_ary[] = (int) $row[$field];
|
||||||
}
|
}
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
|
}
|
||||||
|
|
||||||
$id_ary = array_unique($id_ary);
|
$id_ary = array_unique($id_ary);
|
||||||
}
|
|
||||||
|
|
||||||
// store the ids, from start on then delete anything that isn't on the current page because we only need ids for one page
|
// store the ids, from start on then delete anything that isn't on the current page because we only need ids for one page
|
||||||
$this->save_ids($search_key, implode(' ', $this->split_words), $author_ary, $result_count, $id_ary, $start, $sort_dir);
|
$this->save_ids($search_key, implode(' ', $this->split_words), $author_ary, $result_count, $id_ary, $start, $sort_dir);
|
||||||
@@ -896,9 +895,9 @@ class fulltext_mysql extends \phpbb\search\base
|
|||||||
$id_ary[] = (int) $row[$field];
|
$id_ary[] = (int) $row[$field];
|
||||||
}
|
}
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
|
}
|
||||||
|
|
||||||
$id_ary = array_unique($id_ary);
|
$id_ary = array_unique($id_ary);
|
||||||
}
|
|
||||||
|
|
||||||
if (count($id_ary))
|
if (count($id_ary))
|
||||||
{
|
{
|
||||||
|
@@ -1012,6 +1012,8 @@ class fulltext_native extends \phpbb\search\base
|
|||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$id_ary = array_unique($id_ary);
|
||||||
|
|
||||||
// store the ids, from start on then delete anything that isn't on the current page because we only need ids for one page
|
// store the ids, from start on then delete anything that isn't on the current page because we only need ids for one page
|
||||||
$this->save_ids($search_key, $this->search_query, $author_ary, $total_results, $id_ary, $start, $sort_dir);
|
$this->save_ids($search_key, $this->search_query, $author_ary, $total_results, $id_ary, $start, $sort_dir);
|
||||||
$id_ary = array_slice($id_ary, 0, (int) $per_page);
|
$id_ary = array_slice($id_ary, 0, (int) $per_page);
|
||||||
@@ -1313,6 +1315,8 @@ class fulltext_native extends \phpbb\search\base
|
|||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$id_ary = array_unique($id_ary);
|
||||||
|
|
||||||
if (count($id_ary))
|
if (count($id_ary))
|
||||||
{
|
{
|
||||||
$this->save_ids($search_key, '', $author_ary, $total_results, $id_ary, $start, $sort_dir);
|
$this->save_ids($search_key, '', $author_ary, $total_results, $id_ary, $start, $sort_dir);
|
||||||
|
@@ -545,8 +545,6 @@ class fulltext_postgres extends \phpbb\search\base
|
|||||||
}
|
}
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
|
|
||||||
$id_ary = array_unique($id_ary);
|
|
||||||
|
|
||||||
// if the total result count is not cached yet, retrieve it from the db
|
// if the total result count is not cached yet, retrieve it from the db
|
||||||
if (!$result_count)
|
if (!$result_count)
|
||||||
{
|
{
|
||||||
@@ -576,9 +574,9 @@ class fulltext_postgres extends \phpbb\search\base
|
|||||||
$id_ary[] = $row[$field];
|
$id_ary[] = $row[$field];
|
||||||
}
|
}
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
|
}
|
||||||
|
|
||||||
$id_ary = array_unique($id_ary);
|
$id_ary = array_unique($id_ary);
|
||||||
}
|
|
||||||
|
|
||||||
// store the ids, from start on then delete anything that isn't on the current page because we only need ids for one page
|
// store the ids, from start on then delete anything that isn't on the current page because we only need ids for one page
|
||||||
$this->save_ids($search_key, implode(' ', $this->split_words), $author_ary, $result_count, $id_ary, $start, $sort_dir);
|
$this->save_ids($search_key, implode(' ', $this->split_words), $author_ary, $result_count, $id_ary, $start, $sort_dir);
|
||||||
@@ -858,9 +856,9 @@ class fulltext_postgres extends \phpbb\search\base
|
|||||||
$id_ary[] = (int) $row[$field];
|
$id_ary[] = (int) $row[$field];
|
||||||
}
|
}
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
|
}
|
||||||
|
|
||||||
$id_ary = array_unique($id_ary);
|
$id_ary = array_unique($id_ary);
|
||||||
}
|
|
||||||
|
|
||||||
if (count($id_ary))
|
if (count($id_ary))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user