[wp-trac] [WordPress Trac] #33109: attachment_url_to_postid() fail if url protocols don't match
WordPress Trac
noreply at wordpress.org
Fri Jul 24 04:45:25 UTC 2015
#33109: attachment_url_to_postid() fail if url protocols don't match
--------------------------+------------------------------------
Reporter: welcher | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: trunk
Severity: normal | Keywords: has-patch dev-feedback
Focuses: |
--------------------------+------------------------------------
If `attachment_url_to_postid()` is passed a url with a protocol that does
not match the upload directory url protocol the `substr()` call does not
remove the appropriate part of the url and the subsquent database lookup
does not retrieve the ID correctly and the method returns 0. I discovered
this when working with a client site that had an http front end but an
https backend.
I have attached the unit tests and fix patches separately so the issue can
be seen before applying the fix which resolved the issue.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33109>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list