Skip to content

docs(dev): allowlist user-supplied columns and sort orders in database.rst - #15709

Open
whoalin1 wants to merge 1 commit into
nextcloud:masterfrom
whoalin1:docs-allowlist-columns-sort-database
Open

whoalin1 wants to merge 1 commit into
nextcloud:masterfrom
whoalin1:docs-allowlist-columns-sort-database

Conversation

@whoalin1

@whoalin1 whoalin1 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

database.rst showed createNamedParameter() for values but not that column names and sort directions cannot be bound as parameters.

  • Add a short section after the opening query example: allowlist user-supplied columns / sort orders before orderBy() / select().
  • Include a small PHP match example mapping request input onto allowed identifiers.
  • Note the same rule for Repository findBy() orderBy keys.

Closes #15682

Test plan

  • Sphinx build of the developer manual succeeds for the database page
  • New Allowlisting user-supplied columns and sort orders section appears before Transactions
  • Example uses match for column and sort direction allowlists
  • Section mentions orderBy() / select() and Repository findBy()

AI disclosure

This PR was drafted with the help of AI coding assistants (Cursor agents / LLM-based tools), including the description. I am responsible for it and happy to rework anything that doesn't fit.

All commits carry an Assisted-by: Cursor:grok-4.7 trailer.

…e.rst

Assisted-by: Cursor:grok-4.7
Signed-off-by: whoalin1 <whoalin414@gmail.com>
@whoalin1
whoalin1 force-pushed the docs-allowlist-columns-sort-database branch from 8e6ac67 to 167d98a Compare October 9, 2026 14:12
@github-actions

Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@skjnldsv skjnldsv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sort directions aren't interpolated: orderBy() throws on anything other than ASC/DESC. And Repository::findBy() maps keys through the entity, so raw strings never reach the SQL. The column allowlist advice is good, could you fix those two parts?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Developer manual: allowlist user-supplied columns and sort orders in database.rst

2 participants