diff options
author | Marc Alexander <admin@m-a-styles.de> | 2018-12-29 11:43:23 +0100 |
---|---|---|
committer | 3D-I <marktravai@gmail.com> | 2019-01-06 04:06:16 +0100 |
commit | eead94c8a6829f43df6e0e97ecfa7ef566d92bc3 (patch) | |
tree | 599a4690422c802957f587117a0ef12087d1d82f /phpBB | |
parent | 31b8fdf964585d7021ea86230c7129dedefc3c7d (diff) | |
download | forums-eead94c8a6829f43df6e0e97ecfa7ef566d92bc3.tar forums-eead94c8a6829f43df6e0e97ecfa7ef566d92bc3.tar.gz forums-eead94c8a6829f43df6e0e97ecfa7ef566d92bc3.tar.bz2 forums-eead94c8a6829f43df6e0e97ecfa7ef566d92bc3.tar.xz forums-eead94c8a6829f43df6e0e97ecfa7ef566d92bc3.zip |
[ticket/15889] Use array version of sql_from tables in sql array
PHPBB3-15889
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/memberlist.php | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 30aa0c1140..bcd72762ae 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -1469,11 +1469,23 @@ switch ($mode) // Do the SQL thang 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( 'SELECT' => 'u.*' . $sql_select, - 'FROM' => array( - USERS_TABLE => 'u' . $sql_from - ), + 'FROM' => array_merge([USERS_TABLE => 'u'], $extra_tables), 'WHERE' => $db->sql_in_set('u.user_id', $user_list) . $sql_where_data . '', ); } |