[wp-trac] [WordPress Trac] #29709: get_pagenum_link and double domain
WordPress Trac
noreply at wordpress.org
Fri Sep 19 10:23:39 UTC 2014
#29709: get_pagenum_link and double domain
-------------------------------+------------------------------
Reporter: palmiak | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Permalinks | Version: 4.0
Severity: normal | Resolution:
Keywords: reporter-feedback | Focuses:
-------------------------------+------------------------------
Changes (by SergeyBiryukov):
* keywords: => reporter-feedback
Old description:
> get_pagenum_link generates links with double domain, for example:
> http://domainname.com/http://domainname.com/page/2
>
> The problem doesn't exist on every server and it only appers when you are
> using query_posts (probably new WP_query also).
>
> A the start of get_pagenum_link() there is $request = remove_query_arg(
> 'paged' ); which gets data from $_SERVER. When I'm not using query posts
> [REQUEST_URI] => /test/page/3/ , but after using it I get [REQUEST_URI]
> => http://domainname.com/test/page/3/ .
>
> I think there should be a check if REQUEST_URI doesn't contain
> domainname.
>
> This bug was also found https://wordpress.org/support/topic/error-in-
> link-url-domain-name-appears-twice
New description:
get_pagenum_link generates links with double domain, for example:
http://domainname.com/http://domainname.com/page/2
The problem doesn't exist on every server and it only appers when you are
using query_posts (probably new WP_query also).
A the start of get_pagenum_link() there is `$request = remove_query_arg(
'paged' );` which gets data from $_SERVER. When I'm not using query posts
`[REQUEST_URI] => /test/page/3/`, but after using it I get `[REQUEST_URI]
=> http://domainname.com/test/page/3/`.
I think there should be a check if REQUEST_URI doesn't contain domainname.
This bug was also found https://wordpress.org/support/topic/error-in-link-
url-domain-name-appears-twice
--
Comment:
> When I'm not using query posts `[REQUEST_URI] => /test/page/3/`, but
after using it I get `[REQUEST_URI] =>
http://domainname.com/test/page/3/`.
Could you provide a piece of code to reproduce the issue?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/29709#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list