[wp-trac] [WordPress Trac] #41891: Bug when changing $(comments_)pagination_base of WP_Rewite instance to string with non-ASCII characters

WordPress Trac noreply at wordpress.org
Fri Sep 15 13:05:58 UTC 2017


#41891: Bug when changing $(comments_)pagination_base of WP_Rewite instance to
string with non-ASCII characters
---------------------------+-----------------------------
 Reporter:  dimadin        |      Owner:
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Rewrite Rules  |    Version:
 Severity:  normal         |   Keywords:
  Focuses:                 |
---------------------------+-----------------------------
 When you change `$pagination_base`/`$comments_pagination_base` for
 `WP_Rewrite` instance to string with ASCII characters, it works as
 expected. But when you change to non-ASCII string, it doesn't work because
 it redirects from `/<pagination_base>/2` to
 `/<pagination_base>/2/<pagination_base>/2` which returns 404.  If you use
 `rawurlencode()` on that string, it again works as expected.

 So, in short:
 `$GLOBALS['wp_rewrite']->pagination_base = 'something';` - works
 `$GLOBALS['wp_rewrite']->pagination_base = 'чџш';` - doesn't work
 `$GLOBALS['wp_rewrite']->pagination_base = rawurlencode( 'чџш' );` - works

 This doesn't apply to other bases, they work without `rawurlencode()`, for
 example:
 `$GLOBALS['wp_rewrite']->author_base = 'гдђ';`

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


More information about the wp-trac mailing list