From d8d09e0df2729df000ac8384c48262f8b2d333ac Mon Sep 17 00:00:00 2001 From: PayBas Date: Thu, 7 Aug 2014 14:24:21 +0200 Subject: [PATCH] [ticket/12838] Simplify normal special rank array creation PHPBB3-12838 --- phpBB/phpbb/cache/service.php | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/phpBB/phpbb/cache/service.php b/phpBB/phpbb/cache/service.php index a86e8c31de..b06462fcf0 100644 --- a/phpBB/phpbb/cache/service.php +++ b/phpBB/phpbb/cache/service.php @@ -166,21 +166,14 @@ class service $ranks = array(); while ($row = $this->db->sql_fetchrow($result)) { - foreach ($row as $field => $data) + if ($row['rank_special']) { - if ($field == 'rank_special' || ($row['rank_special'] && $field == 'rank_min')) - { - continue; - } - - if ($row['rank_special']) - { - $ranks['special'][$row['rank_id']][$field] = $data; - } - else - { - $ranks['normal'][$row['rank_id']][$field] = $data; - } + unset($row['rank_min']); + $ranks['special'][$row['rank_id']] = $row; + } + else + { + $ranks['normal'][$row['rank_id']] = $row; } } $this->db->sql_freeresult($result);