Make WordPress Core

Opened 5 years ago

#45819 new defect (bug)

when {category|tag}_base include spaces their rewrite rules don't get generated correctly, resulting in 404's

Reported by: pbiron's profile pbiron Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Permalinks Keywords:
Focuses: Cc:


Steps to reproduce:

  1. Go to Settings > Permalinks
  2. Enter "this is a test" in the category_base field
  3. Click "Save Changes"
  4. Notice that category_base gets saved as "this%20is%20a%20test".
  5. Notice that the rewrite rules such as the following get generated:
    'this%20is%20a%test/(.+?)?$' => 'index.php?%20was%$matches[1]&%20test%$matches[2]'

instead of (what I imagine the correct rule would be)

'this%20is%20a%test/(.+?)?$' => 'index.php?category_name=$matches[1]

I'm not sure whether the best thing to do is to disallow spaces in {category|tag}_base or to fixWP_Rewrite::generate_rewrite_rules() to generate correct rules if they do include spaces.

Change History (0)

Note: See TracTickets for help on using tickets.