Make WordPress Core


Ignore:
Timestamp:
05/29/2015 01:09:26 PM (9 years ago)
Author:
boonebgorges
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp.php

    r32551 r32648  
    308308            }
    309309        }
     310
     311        // Resolve conflicts between posts with numeric slugs and date archive queries.
     312        $this->query_vars = wp_resolve_numeric_slug_conflicts( $this->query_vars );
    310313
    311314        foreach ( (array) $this->private_query_vars as $var) {
Note: See TracChangeset for help on using the changeset viewer.