From 9c8823cde2156b4e68e829a693d415b634d732c1 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 7 Jul 2016 16:23:30 +0200 Subject: [PATCH] fix PHP 5.4 Fatal error: Cannot create references to elements of a temporary array expression --- api/src/Mail/Credentials.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/api/src/Mail/Credentials.php b/api/src/Mail/Credentials.php index ac21f86688..df4f6ed7b6 100644 --- a/api/src/Mail/Credentials.php +++ b/api/src/Mail/Credentials.php @@ -659,14 +659,17 @@ class Credentials static function migrate($acc_id) { try { - foreach((array)self::$cache[$acc_id] as $account_id => &$rows) + if (isset(self::$cache[$acc_id])) { - foreach($rows as $cred_type => &$row) + foreach(self::$cache[$acc_id] as $account_id => &$rows) { - if (self::needMigration($row['cred_pw_enc']) && ($row['cred_pw_enc'] != self::USER || - $row['cred_pw_enc'] == self::USER && $account_id == $GLOBALS['egw_info']['user']['account_id'])) + foreach($rows as $cred_type => &$row) { - self::write($acc_id, $row['cred_username'], self::decrypt($row), $cred_type, $account_id, $row['cred_id']); + if (self::needMigration($row['cred_pw_enc']) && ($row['cred_pw_enc'] != self::USER || + $row['cred_pw_enc'] == self::USER && $account_id == $GLOBALS['egw_info']['user']['account_id'])) + { + self::write($acc_id, $row['cred_username'], self::decrypt($row), $cred_type, $account_id, $row['cred_id']); + } } } }