Skip to content

A quotemeta() convenience function would be nice. #446

Closed
@EvanCarroll

Description

@EvanCarroll

When the user provides input there should be some way to sanitize it as a literal. This is provided in most languages as a core function quotemeta() in perl for instance.

It would be nice if the query object provided such a function. I can patch if it you're interested.

Then you could do something like

[ '%' + Query.quotemeta(req.params(s)) + '%' ]

For the parameterized input, and if the user supplied a '_' or '%' inside it's meant to be taken literally. In fact, I think it'd be good to suggest that of all req.params be sanitized in the docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions