Make sure ORDER BY is SELECTed

git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10398 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Andreas Fischer 2010-01-08 22:38:02 +00:00
parent fffe436914
commit e5c228d564

View file

@ -724,7 +724,7 @@ class phpbb_feed_overall extends phpbb_feed_post_base
$forum_ids[] = 0; $forum_ids[] = 0;
// Determine post ids first for optimization // Determine post ids first for optimization
$sql = 'SELECT post_id $sql = 'SELECT post_id, post_time
FROM ' . POSTS_TABLE . ' FROM ' . POSTS_TABLE . '
WHERE post_approved = 1 WHERE post_approved = 1
AND ' . $db->sql_in_set('forum_id', $forum_ids) . ' AND ' . $db->sql_in_set('forum_id', $forum_ids) . '
@ -738,6 +738,11 @@ class phpbb_feed_overall extends phpbb_feed_post_base
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
if (empty($post_ids))
{
return false;
}
$this->sql = array( $this->sql = array(
'SELECT' => 'f.forum_id, f.forum_name, f.forum_desc_options, ' . 'SELECT' => 'f.forum_id, f.forum_name, f.forum_desc_options, ' .
't.topic_id, t.topic_title, t.topic_time, t.topic_replies, t.topic_views, ' . 't.topic_id, t.topic_title, t.topic_time, t.topic_replies, t.topic_views, ' .
@ -977,7 +982,7 @@ class phpbb_feed_topic extends phpbb_feed_post_base
trigger_error('SORRY_AUTH_READ'); trigger_error('SORRY_AUTH_READ');
} }
$sql = 'SELECT forum_id $sql = 'SELECT forum_id, left_id
FROM ' . FORUMS_TABLE . ' FROM ' . FORUMS_TABLE . '
WHERE forum_type = ' . FORUM_POST . ' WHERE forum_type = ' . FORUM_POST . '
AND ' . $db->sql_in_set('forum_id', $in_fid_ary) . ' AND ' . $db->sql_in_set('forum_id', $in_fid_ary) . '