Skip to content

Commit

Permalink
Preventing multiple iterations
Browse files Browse the repository at this point in the history
  • Loading branch information
karmicdice committed Aug 23, 2014
1 parent f6f794e commit f03393a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Cake/View/Helper/SessionHelper.php
Expand Up @@ -120,6 +120,7 @@ public function flash($key = 'flash', $attrs = array()) {

if (CakeSession::check('Message.' . $key)) {
$flash = CakeSession::read('Message.' . $key);
CakeSession::delete('Message.' . $key);
$message = $flash['message'];
unset($flash['message']);

Expand All @@ -144,7 +145,6 @@ public function flash($key = 'flash', $attrs = array()) {
$tmpVars['message'] = $message;
$out = $this->_View->element($flash['element'], $tmpVars, $options);
}
CakeSession::delete('Message.' . $key);
}
return $out;
}
Expand Down

0 comments on commit f03393a

Please sign in to comment.