[wp-trac] [WordPress Trac] #5305: permalinks broken when article name is numeric

WordPress Trac noreply at wordpress.org
Wed May 27 14:00:26 UTC 2015


#5305: permalinks broken when article name is numeric
--------------------------+---------------------------
 Reporter:  thomask       |       Owner:  valendesigns
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  4.3
Component:  Permalinks    |     Version:  2.3.1
 Severity:  major         |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+---------------------------

Comment (by boonebgorges):

 > Which I think is potentially the biggest issue we face, as the point of
 this ticket is really to fix legacy slugs.

 I disagree - the point of the ticket is to fix numeric slug conflicts. At
 any given time, all existing conflicts are "legacy", but preventing future
 instances of the problem is still a Good Thing.

 Anyway, I was really just throwing 16 out there to see what you thought.
 Let's go with something like [attachment:5305.17.diff], which includes the
 rewrite-level conflict resolution. That patch also includes some
 enhancements to the unit tests so that they work properly with the new
 `wp_unique_post_slug()` changes, as well as new logic that prevents a URL
 like `/2013/05/25` from resolving to `post_name=25` if that post was not
 published in May 2013 (phew).

 > We need to limit the use of the function to specific scenarios so we
 don't introduce unnecessary overhead.

 I think 17.diff is as focused as we're going to get. We can't run on 404,
 because the problem here is not 404s - the problem is that certain URLs
 resolve to date archives when they should resolve to single posts. So we
 only run the additional regex and database query when WP has parsed the
 request as a date archive. Anything more focused than this is probably a
 unicorn.

 I think this is about ready to go, but I'd appreciate a last look.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/5305#comment:88>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list