We're updating the issue view to help you get more done. 

ca_objects::delete() method does not type-check before foreach()

Description

The delete() method of the ca_objects class iterates through representations and deletes those representations before deleting the object itself. This uses a foreach() loop but there is no pre-check to ensure the variable is actually an array before attempting to loop over it.

This might not actually happen in normal circumstances, but it happened to me in the case of unit testing a new plugin, and it seems safe to prevent the error from happening with a simple is_array() check.

Environment

None

Activity

Show:
Ben New
May 14, 2014, 2:46 AM

Pull request is up:

https://github.com/collectiveaccess/providence/pull/100

Was closed by mistake and then reopened.

Assignee

User known

Reporter

Ben New

Labels

Components

Affects versions

Priority

Trivial
Configure