mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
When parsing what appears to be a date archive request, check for a post with a clashing permalink before resolving to the archive.
A URL like `example.com/2015/05/15/` generally resolves to the May 15, 2015 date archive. But in certain cases, it could also be the permalink of a post with the slug `'2015'`. When a conflict of this sort is detected, resolve to the post instead of the archive. URL conflicts of this sort should no longer occur for new posts; see [32647]. Props valendesigns, boonebgorges, Denis-de-Bernardy. Fixes #5305. git-svn-id: https://develop.svn.wordpress.org/trunk@32648 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -308,6 +308,9 @@ class WP {
|
||||
}
|
||||
}
|
||||
|
||||
// Resolve conflicts between posts with numeric slugs and date archive queries.
|
||||
$this->query_vars = wp_resolve_numeric_slug_conflicts( $this->query_vars );
|
||||
|
||||
foreach ( (array) $this->private_query_vars as $var) {
|
||||
if ( isset($this->extra_query_vars[$var]) )
|
||||
$this->query_vars[$var] = $this->extra_query_vars[$var];
|
||||
|
||||
Reference in New Issue
Block a user