Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$or filter doesn't group together conditions #71

Closed
jayalfredprufrock opened this issue Sep 12, 2016 · 2 comments
Closed

$or filter doesn't group together conditions #71

jayalfredprufrock opened this issue Sep 12, 2016 · 2 comments

Comments

@jayalfredprufrock
Copy link
Contributor

jayalfredprufrock commented Sep 12, 2016

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);
 }
@kaiquewdev
Copy link
Contributor

#73

@daffl
Copy link
Member

daffl commented Sep 22, 2016

This should be closed now thanks to @kaiquewdev #73 and #75

@daffl daffl closed this as completed Sep 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants