Skip to content

$or filter doesn't group together conditions #71

@jayalfredprufrock

Description

@jayalfredprufrock

This is a bit of a security issue. (See feathersjs/feathers#404)

I was able to fix this by altering a few lines in the knexify() method to use knex's grouping capabilities. My fork is all screwed up right now so I can't submit a PR at the moment, but I wanted to go ahead and post the fix here:

// line 69
if (method) {
    if (key === '$or') {
        return query.where(function(){
            value.forEach(condition => this[method].call(this, condition));
        });
     }
     return query[method].call(query, column, value);
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions