[wp-trac] [WordPress Trac] #28970: wp_get_attachment_url 0 === should be false ===

WordPress Trac noreply at wordpress.org
Mon Jul 21 04:17:03 UTC 2014


#28970: wp_get_attachment_url 0 === should be false ===
--------------------------+-----------------------------
 Reporter:  brashell      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Media         |    Version:  3.9.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 wp_get_attachment_url() does this

 {{{
             if ( 0 === strpos($file, $uploads['basedir']) ) //Check that
 the upload base exists in the file location
 }}}

 which causes this to happen to media URL's on a multisite install.
 http://mainsite.com/subsite/wp-content/uploads/sites/2/sites/2/2014/07
 /Some-PDF.pdf
 The GUID in the database is correct though (http://mainsite.com/subsite
 /wp-content/uploads/sites/2/2014/07/Some-PDF.pdf), notice it's not
 /sites/2/sites/2/ I will also note this was uploaded via a plugin I made.
 When using false though, it works as it should and returns
 http://mainsite.com/subsite/wp-content/uploads/sites/2/2014/07/Some-
 PDF.pdf

 {{{
             if ( false === strpos($file, $uploads['basedir']) ) //Check
 that the upload base exists in the file location
 }}}

 Sorry, I am having trouble putting this into words and this is my first
 ticket, I think I put all the necessary details in though.

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


More information about the wp-trac mailing list