This repository has been archived by the owner on Sep 24, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 658
Sanitize pass on all controllers args #1399
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In a lot of cases, the sanitization wasn't needed as they are marked up in the schema as `enum`s which can only mean the values match those.
Also add some schema updates for the `arg_option`s
Doh, need to merge |
@joehoyle Any reason you left out the comments controller? |
@joehoyle other than my comment about the comments controller being left out the only other open item I can see is we should also be setting the default values where possible. We can merge this PR, and open issues for both of those items. Just wanted to run it past you to see what you think. |
@rachelbaker ah I didn't do comments because I wanted to check if there was a reason we hadn't switch to using I think another pass / ticker for defaults would be good. |
Merged #1399 |
rachelbaker
added a commit
that referenced
this pull request
Jul 23, 2015
Sanitize pass on Attachments, Meta, Posts, and Terms controller args
This was referenced Jul 23, 2015
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a sweep for all the args to make sure we are snitizing where needed. The basic principle is sanitize evertyhing, however the shema does a bunch of stuff for us so we don't need to sepficy it in every case, such as:
enum
as we have chcking to make sure values are only theseformat
is set in the schema whereby we have validation, for example,date-time
integer
Also, for
content
andtitle
in thewp/v2/posts
endpoint does not have any, aswp_insert_post
handles that depending on whatever permissions the user has, so rather than replicating this, we just pass it through.