Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-6230

use of in_array($foo, array_keys($bar)) in several files

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 3.0.1
    • 3.0.RC7
    • Other
    • None
    • PHP Environment:
      Database:

      There are several files that use in_array($foo, array_keys($bar)) which is explicitly stated in the coding guidelines. A search in Zend Studio resulted in this:

      Found 13 occurrences in 9 files for the word: in_array\(.*?, array_keys\(
       
      /includes/functions_posting.php (2014) 		if ($attach_row['is_orphan'] && !in_array($attach_row['attach_id'], array_keys($orphan_rows)))
      /includes/functions_privmsgs.php (631) 		if (in_array(PRIVMSGS_INBOX, array_keys($move_into_folder)))
      /includes/functions_privmsgs.php (1544) 	if ($attach_row['is_orphan'] && !in_array($attach_row['attach_id'], array_keys($orphan_rows)))
      /includes/ucp/ucp_prefs.php (117) 			if (!in_array($data['dateformat'], array_keys($user->lang['dateformats'])))
      /includes/acp/acp_attachments.php (892) 	if (!in_array($attach_id, array_keys($delete_files)) && !empty($post_ids[$attach_id]))
      /includes/acp/acp_users.php (1336) 			if (!in_array($data['dateformat'], array_keys($user->lang['dateformats'])))
      /includes/acp/acp_board.php (798) 			if (!in_array($value, array_keys($user->lang['dateformats'])))
      /includes/functions.php (1347) 				if (!in_array(base_convert($row['topic_id'], 10, 36), array_keys($check_forum)))
      /includes/functions_module.php (680) 		if (!$current_id && (in_array($item_ary['id'], array_keys($this->module_cache['parents'])) || $item_ary['id'] == $this->p_id))
      /includes/functions_module.php (713) 		'S_SELECTED'	=> (in_array($item_ary['id'], array_keys($this->module_cache['parents'])) || $item_ary['id'] == $this->p_id) ? true : false,
      /includes/functions_module.php (722) 		'S_SELECTED'	=> (in_array($item_ary['id'], array_keys($this->module_cache['parents'])) || $item_ary['id'] == $this->p_id) ? true : false,
      /includes/functions_user.php (3073) 		if (in_array('user_avatar', array_keys($sql_ary)))
      /includes/functions_user.php (3099) 		if (in_array('user_colour', array_keys($sql_ary)))

            Acyd Burn Meik Sievertsen [X] (Inactive)
            Lord Le Brand Lord Le Brand
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: