Opened 13 years ago
Closed 13 years ago
#20374 closed defect (bug) (fixed)
Unit Test failure: ?pagename=actually-a-post-name redirect
Reported by: | markjaquith | Owned by: | markjaquith |
---|---|---|---|
Milestone: | 3.4 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Canonical | Keywords: | |
Focuses: | 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)
#1
@
13 years 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.
#3
@
13 years ago
In [20386]:
Be a bit more conservative in which args are stripped after redirect_guess_404_permalink().
#4
@
13 years ago
- 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.
strip some common parameters that we do not need if we have an actual URL.