[wp-trac] [WordPress Trac] #31060: URL Query strings get escaped and become unusable (observed with function get_pagenum_link() )

WordPress Trac noreply at wordpress.org
Mon Jan 19 22:36:48 UTC 2015


#31060: URL Query strings get escaped and become unusable (observed with function
get_pagenum_link() )
--------------------------+-----------------------------
 Reporter:  fraenk        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 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

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31060>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list