[ticket/12838] Simplify normal special rank array creation

PHPBB3-12838
This commit is contained in:
PayBas 2014-08-07 14:24:21 +02:00
parent 8d8e0aae68
commit d8d09e0df2

View file

@ -166,21 +166,14 @@ class service
$ranks = array(); $ranks = array();
while ($row = $this->db->sql_fetchrow($result)) while ($row = $this->db->sql_fetchrow($result))
{ {
foreach ($row as $field => $data)
{
if ($field == 'rank_special' || ($row['rank_special'] && $field == 'rank_min'))
{
continue;
}
if ($row['rank_special']) if ($row['rank_special'])
{ {
$ranks['special'][$row['rank_id']][$field] = $data; unset($row['rank_min']);
$ranks['special'][$row['rank_id']] = $row;
} }
else else
{ {
$ranks['normal'][$row['rank_id']][$field] = $data; $ranks['normal'][$row['rank_id']] = $row;
}
} }
} }
$this->db->sql_freeresult($result); $this->db->sql_freeresult($result);