[wp-trac] [WordPress Trac] #41457: WP_REST_Comments_Controller::check_read_post_permission() counts an uncountable value

WordPress Trac noreply at wordpress.org
Mon Oct 2 11:31:41 UTC 2017


#41457: WP_REST_Comments_Controller::check_read_post_permission() counts an
uncountable value
-------------------------------------------------+-------------------------
 Reporter:  johnbillion                          |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  4.9
Component:  Comments                             |     Version:  4.7
 Severity:  normal                               |  Resolution:
 Keywords:  needs-unit-tests has-patch needs-    |     Focuses:  rest-api
  testing                                        |
-------------------------------------------------+-------------------------

Comment (by schlessera):

 According to http://phpcheatsheets.com/test/array_tests/ , we get the
 following rules for the result of `count()`:

 * `is_array()` => `count()`
 * `null` => `0`,
 * <everything else> => `1`

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


More information about the wp-trac mailing list