[wp-trac] [WordPress Trac] #37177: Incorrect rest_url when home_url contains parameters
WordPress Trac
noreply at wordpress.org
Sun Jun 26 12:56:28 UTC 2016
#37177: Incorrect rest_url when home_url contains parameters
-----------------------------+----------------------
Reporter: danielbachhuber | Owner:
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: REST API | Version:
Severity: normal | Resolution: wontfix
Keywords: | Focuses:
-----------------------------+----------------------
Changes (by danielbachhuber):
* keywords: needs-patch needs-unit-tests =>
* status: new => closed
* version: 4.4 =>
* resolution: => wontfix
* milestone: 4.6 =>
Comment:
Actually, this appears to be a problem generally with `get_home_url()`
since r12598:
{{{
wp> update_option( 'home', 'http://wordpress-develop.dev/?foo' );
=> bool(true)
wp> get_home_url( null, 'bar' );
=> string(37) "http://wordpress-develop.dev/?foo/bar"
}}}
Specifically:
{{{
if ( $path && is_string( $path ) )
$url .= '/' . ltrim( $path, '/' );
}}}
I think supporting query parameters in `home` opens a huge can of worms,
and shouldn't be supported by WordPress. There are other ways of
accomplishing the same effect.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37177#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list