#31060 closed defect (bug) (duplicate)
URL Query strings get escaped and become unusable (observed with function get_pagenum_link() )
| Reported by: | fraenk | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | 4.1 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
The problem can be reproduced by using a code example from the codex: http://codex.wordpress.org/Function_Reference/paginate_links#Basic_Example
global $wp_query;
$big = 999999999; // need an unlikely integer
echo paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'total' => $wp_query->max_num_pages
) );
prerequisite is to have the default permalink structure active (not pretty permalinks)
it appears as if get_pagenum_link() returns the url with broken query parameters by giving #038; instead of an ampersand.
esc_url is NOT the culprit!
some more detail here: https://wordpress.org/support/topic/url-problem-038-replaces-and-breaks-the-navigation?replies=2#post-6456295
Change History (2)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Duplicate of #30831.