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

Phalcon\Flash\Session::has return true when messages array is empty #15204

Closed
yannux opened this issue Nov 5, 2020 · 1 comment · Fixed by #15353
Closed

Phalcon\Flash\Session::has return true when messages array is empty #15204

yannux opened this issue Nov 5, 2020 · 1 comment · Fixed by #15353
Assignees
Labels
5.0 The issues we want to solve in the 5.0 release bug A bug report status: low Low

Comments

@yannux
Copy link

yannux commented Nov 5, 2020

Hi,

Using Phalcon\Flash\Session::has() return true whereas the messages array is empty.

public function has(type = null) -> bool

/**
     * Checks whether there are messages
     */
    public function has(type = null) -> bool
    {
        var messages;

        let messages = this->getSessionMessages(false);

        if typeof type != "string" {
            return true;
        }

        return isset messages[type];
    }

Sorry I don't understand why type != 'string return true,
but maybe it's possible to add something like :

if empty messages {
    return false;
}

Regards,

@Jeckerson Jeckerson added bug A bug report status: low Low 4.1.1 The issues we want to solve in the 4.1.1 release labels Dec 9, 2020
@Jeckerson Jeckerson added 5.0 The issues we want to solve in the 5.0 release and removed 4.1.1 The issues we want to solve in the 4.1.1 release labels Mar 26, 2021
@niden niden linked a pull request Mar 30, 2021 that will close this issue
5 tasks
@niden
Copy link
Member

niden commented Mar 31, 2021

Resolved in #15353

@niden niden closed this as completed Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.0 The issues we want to solve in the 5.0 release bug A bug report status: low Low
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants