Opened 14 months ago
Closed 14 months ago
#20374 closed defect (bug) (fixed)
Unit Test failure: ?pagename=actually-a-post-name redirect
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.4 |
| Component: | Canonical | Version: | |
| Severity: | normal | Keywords: | |
| Cc: |
Description
The unit test for canonical redirection of ?pagename=actually-a-post-name is failing.
We find the post, but we're failing to strip the ?pagename=slug part.
Attachments (1)
Change History (6)
markjaquith — 14 months ago
comment:1
markjaquith — 14 months ago
- Milestone changed from Future Release to 3.4
- Owner set to markjaquith
- Status changed from new to accepted
This is actually pretty nasty in the case of ?name=incomplete-slug, as it will redirect to /2012/04/incomplete-slug-for-post/?name=incomplete-slug and result in a 404.
comment:2
markjaquith — 14 months ago
- Resolution set to fixed
- Status changed from accepted to closed
In [20380]:
comment:3
markjaquith — 14 months ago
In [20386]:
Be a bit more conservative in which args are stripped after redirect_guess_404_permalink().
- Resolution fixed deleted
- Status changed from closed to reopened
I think this can break a valid URL to a post. Well, specifically, non-post posts.
get_post_permalink() is used to generate links to items of custom post types. A post type's ugly link is in the form of ?post_type=$post_type&p=1234.
This should be reproducible even with pretty permalinks enabled on the site. Setting public = true, query_var = false, rewrite = false should do it.
comment:5
markjaquith — 14 months ago
- Resolution set to fixed
- Status changed from reopened to closed
In [20395]:

strip some common parameters that we do not need if we have an actual URL.