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

Added check for valid SQL before running fetchAll. #12

Conversation

TomHAnderson
Copy link
Contributor

@TomHAnderson TomHAnderson commented Mar 7, 2020

Q A
Documentation no
Bugfix yes
BC Break no
New Feature yes
RFC no
QA no

Description

Fixes laminas-api-tools/api-tools-doctrine-querybuilder#3

api-tools-doctrine-querybuilder allows a user to inject invalid sql into a QueryBuilder. This fix calls the collection adapter query object with getSQL() which triggers the query to parse() https://github.com/doctrine/orm/blob/master/lib/Doctrine/ORM/Query.php#L181 and throws an exception if the query is invalid. This is caught and re-thrown as a DomainException fro ApiProblem.

Unit test included which injects invalid sql to trigger custom 500 error.

@TomHAnderson
Copy link
Contributor Author

Closing due to lack to action.

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

Successfully merging this pull request may close these issues.

Error when enter none existing filed name in filtering
1 participant