[wp-trac] [WordPress Trac] #37812: 404 when using a numeric slug and /%category%/ base

WordPress Trac noreply at wordpress.org
Tue Aug 30 15:55:47 UTC 2016


#37812: 404 when using a numeric slug and /%category%/ base
------------------------------------------+-----------------------------
 Reporter:  mikejolley                    |       Owner:
     Type:  defect (bug)                  |      Status:  new
 Priority:  normal                        |   Milestone:  Future Release
Component:  Permalinks                    |     Version:
 Severity:  normal                        |  Resolution:
 Keywords:  needs-unit-tests needs-patch  |     Focuses:
------------------------------------------+-----------------------------
Changes (by swissspidy):

 * keywords:   => needs-unit-tests needs-patch
 * version:  4.6 =>
 * milestone:  Awaiting Review => Future Release


Comment:

 Confirmed, also on older installs.

 With a non-numerical slug the matched query is
 `category_name=parent%2Fchild&name=test&page=`, whereas with a numerical
 slug it is `category_name=parent&name=child&page=12345`.

 The rewrite rule for the `/%category%/%postname%/` structure is
 `(.+?)/([^/]+)(?:/([0-9]+))?/?$`
 (`category_name=$matches[1]&name=$matches[2]&page=$matches[3]`).

 Looks like numerical slugs should be forbidden in that case and suffixed
 (e.g. `1234-2`). @boonebgorges didn't you fix something similar recently?
 Can't find the ticket.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37812#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list