-
Notifications
You must be signed in to change notification settings - Fork 37
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
escape variables in question bank columns sql #277
base: main
Are you sure you want to change the base?
Conversation
540abab
to
39f3856
Compare
…lect with static values
This PR should simplify the use of the "current" user and studentquiz id in the question bank column queries. First it improves maintainability by not needing to define those all the time, secondly in case additional sanitation has to be made, it is in a well defined place, and thirdly it reduces load to prepare the "big query" by not needing to find the additional field values. Moodle has the option to use |
With help of 0a8d71c:
But this approach doesn't like pgsql. Putting PR aside for a bit |
I don't see why this would not work in Postgres. Perhaps you need to add In studentquiz_bank_view.php, you should be able to do |
I can give that a try.
Yes definitely, now we can do that. |
cfaee3b
to
8f4fe71
Compare
While all used variables are currently safe, this must be considered accidental. We should escape all usages of variables in this query. The question bank column classes really need an overhaul to correctly escape input data!