Skip to content

Checlist item state always true #21

@ilkka-rautiainen

Description

@ilkka-rautiainen

Because of this line:

$this->data['checkItems'][$key]['state'] = in_array($item['state'], array(true, 'complete', 'true'));

$this->data['checkItems'][$key]['state'] = in_array($item['state'], array(true, 'complete', 'true'));

Should be:

$this->data['checkItems'][$key]['state'] = in_array($item['state'], array(true, 'complete', 'true'), true);

The problem is that both 'incomplete' == true and 'complete' == true evaluate to true. The strict mode is required (in_array, third parameter). To me it seems even unneeded to have this kind of in_array check. The values are just 'incomplete' and 'complete', right? Can't we trust on that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions