mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/15889] Use array version of sql_from tables in sql array
PHPBB3-15889
This commit is contained in:
parent
31b8fdf964
commit
eead94c8a6
1 changed files with 15 additions and 3 deletions
|
@ -1469,11 +1469,23 @@ switch ($mode)
|
||||||
// Do the SQL thang
|
// Do the SQL thang
|
||||||
if ($mode == 'group')
|
if ($mode == 'group')
|
||||||
{
|
{
|
||||||
|
$sql_from_ary = explode(',', $sql_from);
|
||||||
|
$extra_tables = [];
|
||||||
|
foreach ($sql_from_ary as $entry)
|
||||||
|
{
|
||||||
|
$table_data = explode(' ', trim($entry));
|
||||||
|
|
||||||
|
if (empty($table_data[0]) || empty($table_data[1]))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$extra_tables[$table_data[0]] = $table_data[1];
|
||||||
|
}
|
||||||
|
|
||||||
$sql_array = array(
|
$sql_array = array(
|
||||||
'SELECT' => 'u.*' . $sql_select,
|
'SELECT' => 'u.*' . $sql_select,
|
||||||
'FROM' => array(
|
'FROM' => array_merge([USERS_TABLE => 'u'], $extra_tables),
|
||||||
USERS_TABLE => 'u' . $sql_from
|
|
||||||
),
|
|
||||||
'WHERE' => $db->sql_in_set('u.user_id', $user_list) . $sql_where_data . '',
|
'WHERE' => $db->sql_in_set('u.user_id', $user_list) . $sql_where_data . '',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue