This function only makes sense if $filter isn't a string. Since more than a string is now accepted, this (and the block for where) should reflect that.