[wp-trac] [WordPress Trac] #30346: Attachments not being found with attachment_url_to_postid()

WordPress Trac noreply at wordpress.org
Fri Nov 14 23:53:57 UTC 2014


#30346: Attachments not being found with attachment_url_to_postid()
--------------------------+-----------------------------
 Reporter:  bradyvercher  |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Media         |    Version:  4.0
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 The
 [https://github.com/WordPress/WordPress/blob/52f51d65ae102e2f16953689b21a79db85dccf2f
 /wp-includes/media.php#L3268 second parameter] for `ltrim()` is a
 character mask, not a string, which currently causes issues for domains
 with a "2" (such as IP addresses). For instance, this URL:

 `http://192.168.1.20/wp-content/uploads/2014/04/image.png`

 Is converted to `4/04/image.png`, but it should be `2014/04/image.png`.

 The new `WP_Customize_Upload_Control` uses `attachment_url_to_postid()` to
 convert URLs to attachments for the Customizer and this bug prevents those
 controls from working properly.

 I haven't looked into it, but this may also affect custom upload paths.

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


More information about the wp-trac mailing list