Merge pull request #6227 from 3D-I/ticket/16793

[ticket/16793] Fix topic/post attachments visibility - PHP 8
This commit is contained in:
Marc Alexander 2021-06-13 11:26:06 +02:00
commit b7f57eb556
No known key found for this signature in database
GPG key ID: 50E0D2423696F995
2 changed files with 7 additions and 7 deletions

View file

@ -220,7 +220,7 @@ else
{ {
phpbb_download_handle_forum_auth($db, $auth, $attachment['topic_id']); phpbb_download_handle_forum_auth($db, $auth, $attachment['topic_id']);
$sql = 'SELECT forum_id, post_visibility $sql = 'SELECT forum_id, poster_id, post_visibility
FROM ' . POSTS_TABLE . ' FROM ' . POSTS_TABLE . '
WHERE post_id = ' . (int) $attachment['post_msg_id']; WHERE post_id = ' . (int) $attachment['post_msg_id'];
$result = $db->sql_query($sql); $result = $db->sql_query($sql);

View file

@ -656,15 +656,15 @@ function phpbb_download_handle_forum_auth($db, $auth, $topic_id)
{ {
global $phpbb_container; global $phpbb_container;
$sql_array = array( $sql_array = [
'SELECT' => 't.topic_visibility, t.forum_id, f.forum_name, f.forum_password, f.parent_id', 'SELECT' => 't.forum_id, t.topic_poster, t.topic_visibility, f.forum_name, f.forum_password, f.parent_id',
'FROM' => array( 'FROM' => [
TOPICS_TABLE => 't', TOPICS_TABLE => 't',
FORUMS_TABLE => 'f', FORUMS_TABLE => 'f',
), ],
'WHERE' => 't.topic_id = ' . (int) $topic_id . ' 'WHERE' => 't.topic_id = ' . (int) $topic_id . '
AND t.forum_id = f.forum_id', AND t.forum_id = f.forum_id',
); ];
$sql = $db->sql_build_query('SELECT', $sql_array); $sql = $db->sql_build_query('SELECT', $sql_array);
$result = $db->sql_query($sql); $result = $db->sql_query($sql);