Opened 9 years ago
Last modified 5 years ago
#36323 new defect (bug)
home_url returns url with wrong scheme
Reported by: | Gerkin | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.4.2 |
Component: | Permalinks | Keywords: | https dev-feedback |
Focuses: | multisite | Cc: |
Description
Hello,
I have a multisite with HTTPS on all subsites. When using
home_url( '/' );
, on a subsite page, logged in user got a https url, when anonymous got just http.
In the track, it seems that the error comes from those lines...
2963 if ( ! in_array( $scheme, array( 'http', 'https', 'relative' ) ) ) {
2964 if ( is_ssl() && ! is_admin() && 'wp-login.php' !== $pagenow )
2965 $scheme = 'https';
2966 else
2967 $scheme = parse_url( $url, PHP_URL_SCHEME );
2968 }
...
Thank you for your time.
Change History (4)
Note: See
TracTickets for help on using
tickets.
Thanks for the report, @Gerkin.
How are you implementing HTTPS on your site? WordPress core doesn't vary the home URL scheme depending on whether or not a user is logged in, so there must be something else affecting its return value, such as a plugin on your site that's filtering the value.