[wp-trac] [WordPress Trac] #34144: `url_to_postid` doesn't recognize URLs with wrong scheme
WordPress Trac
noreply at wordpress.org
Sun Oct 4 11:34:22 UTC 2015
#34144: `url_to_postid` doesn't recognize URLs with wrong scheme
---------------------------+-----------------------------
Reporter: swissspidy | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Rewrite Rules | Version: 1.0
Severity: normal | Keywords: has-patch
Focuses: |
---------------------------+-----------------------------
While working on the oEmbed feature plugin I noticed that `url_to_postid`
doesn't recognize URLs with the wrong URL scheme.
When your site runs HTTPS and you pass a permalink with `http://`, you
won't get the post ID. The same goes when you provide a `https://` URL and
`is_ssl()` is false.
A simple `set_url_scheme( $url )` fixes this. Patch attached.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34144>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list