[wp-trac] [WordPress Trac] #29043: Add checks for empty objects in capabilities.php

WordPress Trac noreply at wordpress.org
Sun Jul 27 20:46:46 UTC 2014


#29043: Add checks for empty objects in capabilities.php
-----------------------------+-----------------------------
 Reporter:  DeBAAT           |      Owner:
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Role/Capability  |    Version:  trunk
 Severity:  normal           |   Keywords:
  Focuses:  administration   |
-----------------------------+-----------------------------
 The Media table shows an error in the column "'''Uploaded to'''" for media
 referring to a post with an unknown post_type (on page "'''/wp-
 admin/upload.php'''").

 Code analysis and debugging showed that the function
 "'''map_meta_cap()'''" in the file "'''/wp-includes/capabilities.php'''"
 was using $post_type objects which might be "null", e.g. on line 1126.
 The patch file included has several suggestions for solving this issue.

 The issue arose because I uploaded some media using the Hueman theme which
 defines a custom post_type "option-tree". When another theme is activated,
 e.g. Twenty Fourteen, the definition of the custom post_type is revoked.

 In my test environment, I can reproduce the defect activating and de-
 activating the Hueman theme for the media uploaded.
 I would like to ask for help to create a smaller and easier test to verify
 this defect. It might involve creating a (media or parent) post with a
 non-existing post_type.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29043>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list