1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-11 19:24:01 +02:00

[ticket/14577] Do not calculate size of array in for loop

For loops that modify the size of the looped arrays were obviously not
changed.

PHPBB3-14577
This commit is contained in:
Marc Alexander
2016-04-02 09:46:54 +02:00
parent 3f5a873e4c
commit 5b61ac06cb
5 changed files with 12 additions and 12 deletions

View File

@@ -1426,7 +1426,7 @@ class acp_attachments
$row['group_name'] = $user->lang['NOT_ASSIGNED'];
$group_name[] = $row;
for ($i = 0; $i < sizeof($group_name); $i++)
for ($i = 0, $groups_size = sizeof($group_name); $i < $groups_size; $i++)
{
if ($default_group === false)
{

View File

@@ -1411,7 +1411,7 @@ class acp_forums
$diff = sizeof($moved_forums) * 2;
$moved_ids = array();
for ($i = 0; $i < sizeof($moved_forums); ++$i)
for ($i = 0, $size = sizeof($moved_forums); $i < $size; ++$i)
{
$moved_ids[] = $moved_forums[$i]['forum_id'];
}

View File

@@ -888,7 +888,7 @@ class acp_modules
$diff = sizeof($moved_modules) * 2;
$moved_ids = array();
for ($i = 0; $i < sizeof($moved_modules); ++$i)
for ($i = 0, $size = sizeof($moved_modules); $i < $size; ++$i)
{
$moved_ids[] = $moved_modules[$i]['module_id'];
}