[wp-trac] [WordPress Trac] #57980: "sanitize_title_with_dashes" function trims dashes incorrectly

WordPress Trac noreply at wordpress.org
Fri Mar 24 13:53:27 UTC 2023


#57980: "sanitize_title_with_dashes" function trims dashes incorrectly
--------------------------+-----------------------------
 Reporter:  dam6pl        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Query         |    Version:  6.1.1
 Severity:  minor         |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Hello,

 I noticed that the "sanitize_title_with_dashes" function when parsing the
 query removes the dashes from the beginning and end of the page slug,
 resulting in all the URLs below displaying the same page:
 1. http://example.com/sample-page/
 2. http://example.com/sample-page---/
 2. http://example.com/---sample-page----/

 This creates problems in terms of SEO, because several pages, under
 different URLs, present the same page content.

 I'm fully aware that changing this behaviour might break something, but
 maybe adding a filter to prevent it is a way?

 Thanks!

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57980>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list