From 358f1e76e30ef40e8a6bbfc67bda026d1f04f622 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 2 Jun 2014 11:40:57 +0200 Subject: [PATCH] Use a new index for the params array, so scrutinizer does not complain --- lib/grouphelper.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/grouphelper.php b/lib/grouphelper.php index 76e6bf89..fbc699e8 100644 --- a/lib/grouphelper.php +++ b/lib/grouphelper.php @@ -47,8 +47,8 @@ class GroupHelper * @param array $activity */ public function addActivity($activity) { - $activity['subjectparams'] = (array) unserialize($activity['subjectparams']); - $activity['messageparams'] = (array) unserialize($activity['messageparams']); + $activity['subjectparams_array'] = unserialize($activity['subjectparams']); + $activity['messageparams_array'] = unserialize($activity['messageparams']); if (!$this->allowGrouping) { $this->activities[] = $activity; @@ -56,10 +56,10 @@ class GroupHelper if ($this->getGroupKey($activity) && $this->getGroupKey($activity) === $this->groupKey) { $parameter = $this->getGroupParameter($activity); if ($parameter !== false) { - if (!is_array($this->openGroup['subjectparams'][$parameter])) { - $this->openGroup['subjectparams'][$parameter] = array($this->openGroup['subjectparams'][$parameter]); + if (!is_array($this->openGroup['subjectparams_array'][$parameter])) { + $this->openGroup['subjectparams_array'][$parameter] = array($this->openGroup['subjectparams_array'][$parameter]); } - $this->openGroup['subjectparams'][$parameter][] = $activity['subjectparams'][$parameter]; + $this->openGroup['subjectparams_array'][$parameter][] = $activity['subjectparams_array'][$parameter]; } } else { if (!empty($this->openGroup)) { @@ -116,14 +116,15 @@ class GroupHelper $return = array(); foreach ($this->activities as $activity) { - $activity['subject_short'] = DataHelper::translation($activity['app'], $activity['subject'], $activity['subjectparams'], true); - $activity['message_short'] = DataHelper::translation($activity['app'], $activity['message'], $activity['messageparams'], true); + $activity['subjectparams'] = $activity['subjectparams_array']; + $activity['messageparams'] = $activity['messageparams_array']; $activity['subject_markup'] = DataHelper::translation($activity['app'], $activity['subject'], $activity['subjectparams'], true, true); $activity['message_markup'] = DataHelper::translation($activity['app'], $activity['message'], $activity['messageparams'], true, true); - - $activity['subject_long'] = DataHelper::translation($activity['app'], $activity['subject'], $activity['subjectparams']); - $activity['message_long'] = DataHelper::translation($activity['app'], $activity['message'], $activity['messageparams']); + $activity['subject_short'] = DataHelper::translation($activity['app'], $activity['subject'], $activity['subjectparams'], true); + $activity['message_short'] = DataHelper::translation($activity['app'], $activity['message'], $activity['messageparams'], true); + $activity['subject_full'] = DataHelper::translation($activity['app'], $activity['subject'], $activity['subjectparams']); + $activity['message_full'] = DataHelper::translation($activity['app'], $activity['message'], $activity['messageparams']); $return[] = $activity; }