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

WordPress Trac noreply at wordpress.org
Fri Nov 21 02:40:08 UTC 2014


#30346: Attachments not being found with attachment_url_to_postid()
--------------------------+------------------
 Reporter:  bradyvercher  |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  4.1
Component:  Media         |     Version:  4.0
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------
Changes (by dd32):

 * milestone:  Awaiting Review => 4.1


Comment:

 Good catch, I'd probably replace this with a leading strpos/substr
 instead: (untested)
 {{{
 if ( 0 === strpos( $path, $dir['baseurl'] . '/' ) ) {
   $path = substr( $path, strlen( $dir['baseurl'] . '/' ) );
 }
 }}}

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


More information about the wp-trac mailing list