[wp-trac] [WordPress Trac] #9008: add a home_url() function to enforce http/https scheme
WordPress Trac
wp-trac at lists.automattic.com
Sun Feb 14 05:15:42 UTC 2010
#9008: add a home_url() function to enforce http/https scheme
-------------------------------+--------------------------------------------
Reporter: Denis-de-Bernardy | Owner: anonymous
Type: enhancement | Status: new
Priority: high | Milestone: 3.0
Component: Template | Version: 2.7
Severity: major | Keywords: 2nd-opinion, has-patches
-------------------------------+--------------------------------------------
Changes (by junsuijin):
* cc: junsuijin@… (added)
* keywords: 2nd-opinion => 2nd-opinion, has-patches
Comment:
home_url() works well but I don't follow the logic on trunk wp-includes
/link-template.php, li 1773
{{{
[...] && !is_admin() [...]
}}}
If I don't want to force SSL logins/admin (due to self-signed certificate
or whatever other reason), but I want to use them personally for security
purposes, any link that takes me back to the frontend returns me to the
non-SSL scheme, which means any links from the frontend to the backend (at
least those using the home_url api), don't work. This seems like a good
enough reason to ensure that the current scheme is preserved on admin page
links by default, and a define (as ryan suggested), could then be added to
alter that behavior if desired. Basically, I think it's safe to assume
that the user will want to maintain whatever scheme they've used to login
with, since their cookies won't be valid for the other scheme.
Additionally, I think nacin's patch to deprecate bloginfo('url') is good
and have submitted an additional patch to use home_url() appropriately on
admin pages. I've also changed the offending line in link-template.php
just to make it clear what I mean, and added comments where there is not
yet an api function to handle the task. Thanks to nacin for his help
finding the other locations that need updating :)
--
Ticket URL: <http://core.trac.wordpress.org/ticket/9008#comment:35>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list