[ticket/14782] Use the $select variable in "Your Posts" search

This commit is contained in:
DavidIQ 2016-09-13 14:10:50 -04:00
parent 4b8e8df55c
commit 6d589a8bb9

View file

@ -1262,7 +1262,7 @@ class fulltext_native extends \phpbb\search\base
if (!$total_results && $is_mysql) if (!$total_results && $is_mysql)
{ {
// Count rows for the executed queries. Replace $select within $sql with SQL_CALC_FOUND_ROWS, and run it. // Count rows for the executed queries. Replace $select within $sql with SQL_CALC_FOUND_ROWS, and run it.
$sql_calc = str_replace('SELECT ' . $select, 'SELECT DISTINCT SQL_CALC_FOUND_ROWS p.post_id', $sql); $sql_calc = str_replace('SELECT ' . $select, 'SELECT DISTINCT SQL_CALC_FOUND_ROWS ' . $select, $sql);
$result = $this->db->sql_query($sql_calc); $result = $this->db->sql_query($sql_calc);
$this->db->sql_freeresult($result); $this->db->sql_freeresult($result);