Skip to content

Commit 2df3703

Browse files
committed
[ticket/13149] Add core.phpbb_log_get_topic_auth_sql_before
PHPBB3-13149
1 parent 34ebbbc commit 2df3703

1 file changed

Lines changed: 23 additions & 3 deletions

File tree

phpBB/phpbb/log/log.php

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -893,9 +893,29 @@ protected function get_topic_auth(array $topic_ids)
893893
$forum_auth = array('f_read' => array(), 'm_' => array());
894894
$topic_ids = array_unique($topic_ids);
895895

896-
$sql = 'SELECT topic_id, forum_id
897-
FROM ' . TOPICS_TABLE . '
898-
WHERE ' . $this->db->sql_in_set('topic_id', array_map('intval', $topic_ids));
896+
$sql_ary = array(
897+
'SELECT' => 'topic_id, forum_id',
898+
'FROM' => array(
899+
TOPICS_TABLE => 't',
900+
),
901+
'WHERE' => $this->db->sql_in_set('topic_id', array_map('intval', $topic_ids)),
902+
);
903+
904+
/**
905+
* Allow modifying SQL query before topic data is retrieved.
906+
*
907+
* @event core.phpbb_log_get_topic_auth_sql_before
908+
* @var array topic_ids Array with unique topic IDs
909+
* @var array sql_ary SQL array
910+
* @since 3.1.11-RC1
911+
*/
912+
$vars = array(
913+
'topic_ids',
914+
'sql_ary',
915+
);
916+
extract($this->dispatcher->trigger_event('core.phpbb_log_get_topic_auth_sql_before', compact($vars)));
917+
918+
$sql = $this->db->sql_build_query('SELECT', $sql_ary);
899919
$result = $this->db->sql_query($sql);
900920

901921
while ($row = $this->db->sql_fetchrow($result))

0 commit comments

Comments
 (0)