Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] \Phalcon\Session\Flash::getMessages() #11941 #11942

Closed
wants to merge 2 commits into from
Closed

[BUG] \Phalcon\Session\Flash::getMessages() #11941 #11942

wants to merge 2 commits into from

Conversation

tugrul
Copy link
Contributor

@tugrul tugrul commented Jul 1, 2016

if !isset(messages[type])) {
return [];
}

if !fetch returnMessages, messages[type] {
Copy link
Contributor

@Jurigag Jurigag Jul 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this fetch supposed to do what this if above is doing ? I think you only need to remove && isset(messages[type]) from original code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jurigag I'm not familiar to code Zephir. I looked up behavior of fetch operator and you are right.

Following block possibly better:

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

    return [];
}

I'm going to commit this.

@sergeyklay
Copy link
Contributor

We don't add changes directly to stable branches or master. Could you please send this PR to the 2.1.x branch?

@sergeyklay
Copy link
Contributor

Fixed in the 2.1.x branch.

@sergeyklay sergeyklay closed this Jul 3, 2016
@tugrul tugrul deleted the bug_11941 branch July 3, 2016 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants