diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 368015c1e5..9a7bcab3ea 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -1685,8 +1685,8 @@ function phpbb_show_profile($data, $user_notes_enabled = false, $warn_user_enabl 'U_EMAIL' => $email, 'U_JABBER' => ($data['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=jabber&u=' . $user_id) : '', - 'USER_JABBER' => ($config['jab_enable']) ? $data['user_jabber'] : '', - 'USER_JABBER_IMG' => ($config['jab_enable'] && $data['user_jabber']) ? $user->img('icon_contact_jabber', $data['user_jabber']) : '', + 'USER_JABBER' => ($config['jab_enable'] && $auth->acl_get('u_sendim')) ? $data['user_jabber'] : '', + 'USER_JABBER_IMG' => ($config['jab_enable'] && $auth->acl_get('u_sendim') && $data['user_jabber']) ? $user->img('icon_contact_jabber', $data['user_jabber']) : '', 'L_SEND_EMAIL_USER' => $user->lang('SEND_EMAIL_USER', $username), 'L_CONTACT_USER' => $user->lang('CONTACT_USER', $username), diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index e933b54c17..e187bbb89f 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -1018,7 +1018,7 @@ switch ($mode) $sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'c' => $user->lang['SORT_JOINED'], 'd' => $user->lang['SORT_POST_COUNT']); $sort_key_sql = array('a' => 'u.username_clean', 'c' => 'u.user_regdate', 'd' => 'u.user_posts'); - if ($config['jab_enable']) + if ($config['jab_enable'] && $auth->acl_get('u_sendim')) { $sort_key_text['k'] = $user->lang['JABBER']; $sort_key_sql['k'] = 'u.user_jabber'; diff --git a/tests/profilefields/manager_test.php b/tests/profilefields/manager_test.php index 5431c97125..191869d62b 100644 --- a/tests/profilefields/manager_test.php +++ b/tests/profilefields/manager_test.php @@ -39,22 +39,28 @@ class manager_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/manager.xml'); } - public function setUp() + public function setUp(): void { parent::setUp(); global $phpbb_root_path, $phpEx, $table_prefix; $this->db = $this->new_dbal(); - $this->db_tools = $this->getMock('\phpbb\db\tools\tools', [], [$this->db]); + $this->db_tools = $this->getMockBuilder('\phpbb\db\tools\tools') + ->setConstructorArgs([$this->db]) + ->getMock(); $this->config_text = new \phpbb\config\db_text($this->db, $table_prefix . 'config_text'); $this->table_prefix = $table_prefix; $container = new phpbb_mock_container_builder(); $dispatcher = new phpbb_mock_event_dispatcher(); - $request = $this->getMock('\phpbb\request\request'); - $template = $this->getMock('\phpbb\template\template'); + $request = $this->getMockBuilder('\phpbb\request\request') + ->disableOriginalConstructor() + ->getMock(); + $template = $this->getMockBuilder('\phpbb\template\template') + ->disableOriginalConstructor() + ->getMock(); $auth = new \phpbb\auth\auth(); $language = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)); @@ -161,7 +167,7 @@ class manager_test extends phpbb_database_test_case WHERE ' . $this->db->sql_in_set('field_id', $field_ids); $this->assertSqlResultEquals([], $sql, 'All profile fields lang should be removed'); - $sql = 'SELECT field_id, field_order + $sql = 'SELECT field_id, field_order FROM ' . $this->table_prefix . 'profile_fields ORDER BY field_id ASC'; $this->assertSqlResultEquals([