mirror of
https://github.com/phpbb/phpbb.git
synced 2025-04-14 04:42:04 +02:00
[ticket/16277] Move from each() function
PHPBB3-16277
This commit is contained in:
parent
94808e2cbc
commit
80de9f6a68
@ -694,8 +694,8 @@ class acp_permissions
|
||||
}
|
||||
|
||||
// We loop through the auth settings defined in our submit
|
||||
list($ug_id, ) = each($psubmit);
|
||||
list($forum_id, ) = each($psubmit[$ug_id]);
|
||||
$ug_id = key($psubmit);
|
||||
$forum_id = key($psubmit[$ug_id]);
|
||||
|
||||
$settings = $request->variable('setting', array(0 => array(0 => array('' => 0))), false, \phpbb\request\request_interface::POST);
|
||||
if (empty($settings) || empty($settings[$ug_id]) || empty($settings[$ug_id][$forum_id]))
|
||||
|
@ -460,8 +460,7 @@ class auth_admin extends \phpbb\auth\auth
|
||||
'S_GROUP_MODE' => ($user_mode == 'group') ? true : false)
|
||||
);
|
||||
|
||||
@reset($content_array);
|
||||
while (list($ug_id, $ug_array) = each($content_array))
|
||||
foreach ($content_array as $ug_id => $ug_array)
|
||||
{
|
||||
// Build role dropdown options
|
||||
$current_role_id = (isset($cur_roles[$ug_id][$forum_id])) ? $cur_roles[$ug_id][$forum_id] : 0;
|
||||
@ -471,8 +470,7 @@ class auth_admin extends \phpbb\auth\auth
|
||||
$s_role_options = '';
|
||||
$current_role_id = (isset($cur_roles[$ug_id][$forum_id])) ? $cur_roles[$ug_id][$forum_id] : 0;
|
||||
|
||||
@reset($roles);
|
||||
while (list($role_id, $role_row) = each($roles))
|
||||
foreach ($roles as $role_id => $role_row)
|
||||
{
|
||||
$role_description = (!empty($user->lang[$role_row['role_description']])) ? $user->lang[$role_row['role_description']] : nl2br($role_row['role_description']);
|
||||
$role_name = (!empty($user->lang[$role_row['role_name']])) ? $user->lang[$role_row['role_name']] : $role_row['role_name'];
|
||||
@ -559,8 +557,7 @@ class auth_admin extends \phpbb\auth\auth
|
||||
'S_GROUP_MODE' => ($user_mode == 'group') ? true : false)
|
||||
);
|
||||
|
||||
@reset($content_array);
|
||||
while (list($forum_id, $forum_array) = each($content_array))
|
||||
foreach ($content_array as $forum_id => $forum_array)
|
||||
{
|
||||
// Build role dropdown options
|
||||
$current_role_id = (isset($cur_roles[$ug_id][$forum_id])) ? $cur_roles[$ug_id][$forum_id] : 0;
|
||||
@ -570,8 +567,7 @@ class auth_admin extends \phpbb\auth\auth
|
||||
$current_role_id = (isset($cur_roles[$ug_id][$forum_id])) ? $cur_roles[$ug_id][$forum_id] : 0;
|
||||
$s_role_options = '';
|
||||
|
||||
@reset($roles);
|
||||
while (list($role_id, $role_row) = each($roles))
|
||||
foreach ($roles as $role_id => $role_row)
|
||||
{
|
||||
$role_description = (!empty($user->lang[$role_row['role_description']])) ? $user->lang[$role_row['role_description']] : nl2br($role_row['role_description']);
|
||||
$role_name = (!empty($user->lang[$role_row['role_name']])) ? $user->lang[$role_row['role_name']] : $role_row['role_name'];
|
||||
@ -1138,8 +1134,7 @@ class auth_admin extends \phpbb\auth\auth
|
||||
/* @var $phpbb_permissions \phpbb\permissions */
|
||||
$phpbb_permissions = $phpbb_container->get('acl.permissions');
|
||||
|
||||
@reset($category_array);
|
||||
while (list($cat, $cat_array) = each($category_array))
|
||||
foreach ($category_array as $cat => $cat_array)
|
||||
{
|
||||
if (!$phpbb_permissions->category_defined($cat))
|
||||
{
|
||||
@ -1169,8 +1164,7 @@ class auth_admin extends \phpbb\auth\auth
|
||||
}
|
||||
unset($key_array, $values_array);
|
||||
*/
|
||||
@reset($cat_array['permissions']);
|
||||
while (list($permission, $allowed) = each($cat_array['permissions']))
|
||||
foreach ($cat_array['permissions'] as $permission => $allowed)
|
||||
{
|
||||
if (!$phpbb_permissions->permission_defined($permission))
|
||||
{
|
||||
@ -1237,8 +1231,7 @@ class auth_admin extends \phpbb\auth\auth
|
||||
$permissions = $permission_row[$forum_id];
|
||||
ksort($permissions);
|
||||
|
||||
@reset($permissions);
|
||||
while (list($permission, $auth_setting) = each($permissions))
|
||||
foreach ($permissions as $permission => $auth_setting)
|
||||
{
|
||||
$cat = $phpbb_permissions->get_permission_category($permission);
|
||||
|
||||
|
@ -285,7 +285,7 @@ class diff_engine
|
||||
$matches = $ymatches[$line];
|
||||
|
||||
reset($matches);
|
||||
while (list(, $y) = each($matches))
|
||||
while ($y = current($matches))
|
||||
{
|
||||
if (empty($this->in_seq[$y]))
|
||||
{
|
||||
@ -296,7 +296,7 @@ class diff_engine
|
||||
}
|
||||
|
||||
// no reset() here
|
||||
while (list(, $y) = each($matches))
|
||||
while ($y = current($matches))
|
||||
{
|
||||
if ($y > $this->seq[$k - 1])
|
||||
{
|
||||
|
@ -1209,7 +1209,8 @@ function get_config()
|
||||
if (is_array($convert->config_schema['table_format']))
|
||||
{
|
||||
$convert_config = array();
|
||||
list($key, $val) = each($convert->config_schema['table_format']);
|
||||
$key = key($convert->config_schema['table_format']);
|
||||
$val = current($convert->config_schema['table_format']);
|
||||
|
||||
do
|
||||
{
|
||||
|
@ -44,7 +44,7 @@ class mcp_logs
|
||||
|
||||
if (is_array($action))
|
||||
{
|
||||
list($action, ) = each($action);
|
||||
$action = key($action);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -42,7 +42,7 @@ class mcp_notes
|
||||
|
||||
if (is_array($action))
|
||||
{
|
||||
list($action, ) = each($action);
|
||||
$action = key($action);
|
||||
}
|
||||
|
||||
$this->page_title = 'MCP_NOTES';
|
||||
|
@ -41,7 +41,7 @@ class mcp_warn
|
||||
|
||||
if (is_array($action))
|
||||
{
|
||||
list($action, ) = each($action);
|
||||
$action = key($action);
|
||||
}
|
||||
|
||||
$this->page_title = 'MCP_WARN';
|
||||
|
@ -136,7 +136,7 @@ class ucp_groups
|
||||
{
|
||||
trigger_error($user->lang['NOT_MEMBER_OF_GROUP'] . $return_page);
|
||||
}
|
||||
list(, $row) = each($row);
|
||||
$row = current($row);
|
||||
|
||||
$sql = 'SELECT group_type
|
||||
FROM ' . GROUPS_TABLE . '
|
||||
@ -240,7 +240,7 @@ class ucp_groups
|
||||
{
|
||||
trigger_error($user->lang['NOT_MEMBER_OF_GROUP'] . $return_page);
|
||||
}
|
||||
list(, $row) = each($row);
|
||||
$row = current($row);
|
||||
|
||||
if (!$row['group_leader'])
|
||||
{
|
||||
@ -460,7 +460,7 @@ class ucp_groups
|
||||
{
|
||||
trigger_error($user->lang['NOT_MEMBER_OF_GROUP'] . $return_page);
|
||||
}
|
||||
list(, $row) = each($row);
|
||||
$row = current($row);
|
||||
|
||||
if (!$row['group_leader'])
|
||||
{
|
||||
@ -754,7 +754,7 @@ class ucp_groups
|
||||
{
|
||||
trigger_error($user->lang['NOT_MEMBER_OF_GROUP'] . $return_page);
|
||||
}
|
||||
list(, $row) = each($row);
|
||||
$row = current($row);
|
||||
|
||||
if (!$row['group_leader'])
|
||||
{
|
||||
@ -879,7 +879,7 @@ class ucp_groups
|
||||
{
|
||||
trigger_error($user->lang['NOT_MEMBER_OF_GROUP'] . $return_page);
|
||||
}
|
||||
list(, $row) = each($row);
|
||||
$row = current($row);
|
||||
|
||||
if (!$row['group_leader'])
|
||||
{
|
||||
@ -906,7 +906,7 @@ class ucp_groups
|
||||
{
|
||||
trigger_error($user->lang['NOT_MEMBER_OF_GROUP'] . $return_page);
|
||||
}
|
||||
list(, $row) = each($row);
|
||||
$row = current($row);
|
||||
|
||||
if (!$row['group_leader'])
|
||||
{
|
||||
@ -985,7 +985,7 @@ class ucp_groups
|
||||
{
|
||||
trigger_error($user->lang['NOT_MEMBER_OF_GROUP'] . $return_page);
|
||||
}
|
||||
list(, $row) = each($row);
|
||||
$row = current($row);
|
||||
|
||||
if (!$row['group_leader'])
|
||||
{
|
||||
@ -1046,7 +1046,7 @@ class ucp_groups
|
||||
{
|
||||
trigger_error($user->lang['NOT_MEMBER_OF_GROUP'] . $return_page);
|
||||
}
|
||||
list(, $row) = each($row);
|
||||
$row = current($row);
|
||||
|
||||
if (!$row['group_leader'])
|
||||
{
|
||||
|
@ -61,7 +61,7 @@ if ($forum_action !== '' && $request->variable('sort', false, false, \phpbb\requ
|
||||
|
||||
if (count($action_ary))
|
||||
{
|
||||
list($action, ) = each($action_ary);
|
||||
$action = key($action_ary);
|
||||
}
|
||||
unset($action_ary);
|
||||
|
||||
|
@ -106,7 +106,8 @@ class type_cast_helper implements \phpbb\request\type_cast_helper_interface
|
||||
return;
|
||||
}
|
||||
|
||||
list($default_key, $default_value) = each($default);
|
||||
$default_key = key($default);
|
||||
$default_value = current($default);
|
||||
$key_type = gettype($default_key);
|
||||
|
||||
$_var = $var;
|
||||
|
Loading…
x
Reference in New Issue
Block a user