[wp-trac] [WordPress Trac] #27802: Notice: Illegal member variable name in media.php on line 2418 due to invalid attachment

WordPress Trac noreply at wordpress.org
Tue Apr 15 19:02:38 UTC 2014


#27802: Notice: Illegal member variable name in media.php on line 2418 due to
invalid attachment
-----------------------------+--------------------
 Reporter:  bobbingwide      |       Owner:
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  3.9
Component:  Upgrade/Install  |     Version:  trunk
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |     Focuses:
-----------------------------+--------------------

Comment (by nacin):

 This is fun. So:
  * Uploading a theme (and probably a plugin) doesn't actually set a mime
 type. This appears broken in general, not just when you upload a theme a
 second time. I only needed to upload it once to trigger it.
  * wp_count_attachments() should ignore empty mime types to avoid
 returning an object with an invalid member name.
  * This notice doesn't actually occur until we attempt to access the
 member name, in this case by iterating over it with a foreach.

 I am perfectly fine with papering over this for now by converting it back
 to an array. I just wanted to make sure I understood what was going on.

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


More information about the wp-trac mailing list