aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-04-13 20:45:29 +0200
committerJoas Schilling <nickvergessen@gmx.de>2014-04-25 11:52:25 +0200
commit70f5686efb668f656310c168f1d43be483f1dd60 (patch)
tree3d1e4e95a5a5d662f72a2cbe9e114dad851373cd
parent1d61fcf3c9cb9a92a6c9124cc15e4fd6d61fff6e (diff)
downloadforums-70f5686efb668f656310c168f1d43be483f1dd60.tar
forums-70f5686efb668f656310c168f1d43be483f1dd60.tar.gz
forums-70f5686efb668f656310c168f1d43be483f1dd60.tar.bz2
forums-70f5686efb668f656310c168f1d43be483f1dd60.tar.xz
forums-70f5686efb668f656310c168f1d43be483f1dd60.zip
[ticket/12371] Fix query in mcp_sorting()
PHPBB3-12371
-rw-r--r--phpBB/mcp.php3
1 files changed, 1 insertions, 2 deletions
diff --git a/phpBB/mcp.php b/phpBB/mcp.php
index d77dfbd227..3c6953b37c 100644
--- a/phpBB/mcp.php
+++ b/phpBB/mcp.php
@@ -686,8 +686,7 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql,
$sql = 'SELECT COUNT(p.post_id) AS total
FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t
$where_sql " . $db->sql_in_set('p.forum_id', ($forum_id) ? array($forum_id) : array_intersect(get_forum_list('f_read'), get_forum_list('m_approve'))) . '
- AND p.post_visibility = ' . $visibility_const . '
- AND ' . $db->sql_in_set('topic_visibility', $visibility_const) .'
+ AND ' . $db->sql_in_set('p.post_visibility', $visibility_const) .'
AND t.topic_id = p.topic_id
AND t.topic_visibility <> p.post_visibility';