Skip to content

Commit

Permalink
Cleanup Flash Session
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyklay committed Jul 3, 2016
1 parent 0b1b955 commit 0adfc4c
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions phalcon/flash/session.zep
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,16 @@ class Session extends FlashBase implements FlashInterface
messages = session->get("_flashMessages");

if typeof type == "string" {
if !isset messages[type] {
return [];
}

if !fetch returnMessages, messages[type] {
let returnMessages = [];
}
if fetch returnMessages, messages[type] {
if remove === true {
unset(messages[type]);
session->set("_flashMessages", messages);
}

if remove === true {
unset(messages[type]);
session->set("_flashMessages", messages);
return returnMessages;
}

return returnMessages;
return [];
}

if remove === true {
Expand Down

0 comments on commit 0adfc4c

Please sign in to comment.