The if statement was backwards, and the array_splice was used wrong. Array splice returns the ones it removed, it automatically saves back to the array that it was given. So the original code was saving the ones that were suppose to be removed.

Attached is a patch that fixes it all.

Comments

mikemiles86’s picture

Status: Needs review » Reviewed & tested by the community