mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/11271] Use class variable $db instead of global
PHPBB3-11271
This commit is contained in:
parent
7a971f896d
commit
e2f72539e1
1 changed files with 4 additions and 6 deletions
|
@ -60,8 +60,6 @@ abstract class post_base extends \phpbb\feed\base
|
|||
|
||||
function fetch_attachments()
|
||||
{
|
||||
global $db;
|
||||
|
||||
$sql_array = array(
|
||||
'SELECT' => 'a.*',
|
||||
'FROM' => array(
|
||||
|
@ -86,14 +84,14 @@ abstract class post_base extends \phpbb\feed\base
|
|||
$sql_array['WHERE'] .= 'AND t.forum_id = ' . (int) $this->forum_id;
|
||||
}
|
||||
|
||||
$sql = $db->sql_build_query('SELECT', $sql_array);
|
||||
$result = $db->sql_query($sql);
|
||||
$sql = $this->db->sql_build_query('SELECT', $sql_array);
|
||||
$result = $this->db->sql_query($sql);
|
||||
|
||||
// Set attachments in feed items
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
$this->attachments[$row['post_msg_id']][] = $row;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
$this->db->sql_freeresult($result);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue