aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2016-12-03 15:54:09 +0100
committerMarc Alexander <admin@m-a-styles.de>2016-12-03 15:54:09 +0100
commitfbe5193359e46aa6e28308a0d018d09785e4e9e6 (patch)
tree88e5ef8dae22ad1f4502f140368c44060a0b030a
parentb51247e1daf1d60e89b91d9514bc9f62f6615d16 (diff)
parent2df3703b2aee76d97717b73049e741b68ed514fa (diff)
downloadforums-fbe5193359e46aa6e28308a0d018d09785e4e9e6.tar
forums-fbe5193359e46aa6e28308a0d018d09785e4e9e6.tar.gz
forums-fbe5193359e46aa6e28308a0d018d09785e4e9e6.tar.bz2
forums-fbe5193359e46aa6e28308a0d018d09785e4e9e6.tar.xz
forums-fbe5193359e46aa6e28308a0d018d09785e4e9e6.zip
Merge pull request #4522 from senky/ticket/13149
[ticket/13149] Add core.phpbb_log_get_topic_auth_sql_before
-rw-r--r--phpBB/phpbb/log/log.php26
1 files changed, 23 insertions, 3 deletions
diff --git a/phpBB/phpbb/log/log.php b/phpBB/phpbb/log/log.php
index 094ff78abe..8f199cd931 100644
--- a/phpBB/phpbb/log/log.php
+++ b/phpBB/phpbb/log/log.php
@@ -893,9 +893,29 @@ class log implements \phpbb\log\log_interface
$forum_auth = array('f_read' => array(), 'm_' => array());
$topic_ids = array_unique($topic_ids);
- $sql = 'SELECT topic_id, forum_id
- FROM ' . TOPICS_TABLE . '
- WHERE ' . $this->db->sql_in_set('topic_id', array_map('intval', $topic_ids));
+ $sql_ary = array(
+ 'SELECT' => 'topic_id, forum_id',
+ 'FROM' => array(
+ TOPICS_TABLE => 't',
+ ),
+ 'WHERE' => $this->db->sql_in_set('topic_id', array_map('intval', $topic_ids)),
+ );
+
+ /**
+ * Allow modifying SQL query before topic data is retrieved.
+ *
+ * @event core.phpbb_log_get_topic_auth_sql_before
+ * @var array topic_ids Array with unique topic IDs
+ * @var array sql_ary SQL array
+ * @since 3.1.11-RC1
+ */
+ $vars = array(
+ 'topic_ids',
+ 'sql_ary',
+ );
+ extract($this->dispatcher->trigger_event('core.phpbb_log_get_topic_auth_sql_before', compact($vars)));
+
+ $sql = $this->db->sql_build_query('SELECT', $sql_ary);
$result = $this->db->sql_query($sql);
while ($row = $this->db->sql_fetchrow($result))