[wp-trac] [WordPress Trac] #39010: REST API: Treat null and other falsy values like `false` in 'rest_allow_anonymous_comments'

WordPress Trac noreply at wordpress.org
Sun Dec 4 19:29:20 UTC 2016


#39010: REST API: Treat null and other falsy values like `false` in
'rest_allow_anonymous_comments'
---------------------------------------------+----------------------
 Reporter:  jnylen0                          |       Owner:  jnylen0
     Type:  enhancement                      |      Status:  closed
 Priority:  normal                           |   Milestone:  4.7.1
Component:  REST API                         |     Version:  trunk
 Severity:  normal                           |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests commit  |     Focuses:
---------------------------------------------+----------------------
Changes (by jnylen0):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"39487"]:
 {{{
 #!CommitTicketReference repository="" revision="39487"
 REST API: Treat any falsy value as `false` in
 'rest_allow_anonymous_comments'.

 Extend the check in 'rest_allow_anonymous_comments' to accept any falsy
 value
 (previously this was an explicit check for `false`).

 One possible failure case 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`.

 Props joehoyle, jnylen0.

 Fixes #39010.
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39010#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list