Opened 8 years ago
Closed 8 years ago
#39010 closed enhancement (fixed)
REST API: Treat null and other falsy values like `false` in 'rest_allow_anonymous_comments'
Reported by: | jnylen0 | Owned by: | jnylen0 |
---|---|---|---|
Milestone: | 4.7.1 | Priority: | normal |
Severity: | normal | Version: | 4.7 |
Component: | REST API | Keywords: | has-patch has-unit-tests commit fixed-major |
Focuses: | Cc: |
Description
Currently the rest_allow_anonymous_comments
filter checks for an explicit false
value to disable anonymous comments. We should extend this check to any falsy value instead.
As noted in the tests, the specific case I'm envisioning is that a plugin developer forgets to include a return value for some code path in their callback for this filter, leading to a value of null
which is currently treated like true
. We should fix this before it has a chance to show up in the wild.
Props @joehoyle for originally spotting this at ticket:38855#comment:6, but it wasn't addressed in the commit there.
Attachments (1)
Change History (12)
This ticket was mentioned in Slack in #core-restapi by jnylen. View the logs.
8 years ago
#6
@
8 years ago
- Keywords commit added
- Owner set to jnylen0
- Status changed from new to assigned
Patch 39010.diff looks good. @jnylen0 you want to commit when ready?
#8
@
8 years ago
- Keywords fixed-minor added
- Resolution fixed deleted
- Status changed from closed to reopened
Needs merge to 4.7.1 after the 4.7 release.
@rachelbaker if we don't fix this in 4.7, is it something that we can still go back and fix later?