[wp-trac] [WordPress Trac] #30285: url_to_postid on FORCE_SSL_ADMIN takes https path instead of http

WordPress Trac noreply at wordpress.org
Fri Nov 7 17:59:54 UTC 2014


#30285: url_to_postid on FORCE_SSL_ADMIN takes https path instead of http
--------------------------+-----------------------------
 Reporter:  Ste_95        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.0
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 A server has FORCE_SSL_ADMIN set to TRUE, which makes its wp-admin load
 under SSL, though the public pages are still on http.

 Now, I have a plugin which runs in the admin area. When I call
 url_to_postid with a post permalink under http
 (http://www.domain.com/post) the function always returns 0. What happens
 is that url_to_postid uses site_url to parse the permalink, but site_url
 with FORCE_SSL_ADMIN returns the path with https, thus not finding it in
 the http permalink.

 I think url_to_postid should always take the public settings even when
 called from an admin context, as it will take in input public paths.

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


More information about the wp-trac mailing list