Merge pull request #4353 from karmicdice/patch-1

Prevent infinite loops by rendering a flash element inside a flash element.

Fixes: #4350
This commit is contained in:
Mark Story 2014-08-23 12:49:21 +02:00
commit 72f62b739e

View file

@ -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;
}