From f03393a2a39e62ebc1aca888f5a4eb13d70ee82c Mon Sep 17 00:00:00 2001 From: Karma Dice Date: Sat, 23 Aug 2014 15:47:12 +0530 Subject: [PATCH] Preventing multiple iterations --- lib/Cake/View/Helper/SessionHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/View/Helper/SessionHelper.php b/lib/Cake/View/Helper/SessionHelper.php index d52726f83..9ea5e65f9 100644 --- a/lib/Cake/View/Helper/SessionHelper.php +++ b/lib/Cake/View/Helper/SessionHelper.php @@ -120,6 +120,7 @@ class SessionHelper extends AppHelper { if (CakeSession::check('Message.' . $key)) { $flash = CakeSession::read('Message.' . $key); + CakeSession::delete('Message.' . $key); $message = $flash['message']; unset($flash['message']); @@ -144,7 +145,6 @@ class SessionHelper extends AppHelper { $tmpVars['message'] = $message; $out = $this->_View->element($flash['element'], $tmpVars, $options); } - CakeSession::delete('Message.' . $key); } return $out; }