Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#1426 closed defect (bug) (wontfix)

postname(postslug) ending with "-" returns blank page, and such URLs dont work.

Reported by: carthik Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Administration Keywords:
Focuses: Cc:


WordPress seems to have issues with "postname"s ending with the "-" character. It will not allow me to save a postname that ends with the character, and the URLs return a 404 after I used a mysql to change the postname fields directly.

Steps to reproduce:

  1. Use :

as the permalink structure,

  1. Edit an existing post, changing the postname (post slug), to one ending with the character "-", such as "browse-me-"
  1. Try to save the post.
  1. Observe the blank page after the save button is clicked.


I tried and modified the postnames to end with - in the database directly, after which the URLs were not accessible. I got 404 error when I tried to click through to such posts, which had URLs that ended with "-/".

All this happened in the course of trying to help someone move their typepad blog over to WordPress, though I cannot provide the URLs, since they may have changed by the time you try to access them, this behavior has been observed at three different blogs.

Change History (2)

#1 @carthik
16 years ago

The problem is due to this line in functions-formatting.php :

$title = trim($title, '-');

(it is in the function sanitize-title-with-dashes )

Is this really neccessary? Removing this, or ensuring that trailing slashes in titles, will make migrations from typepad easier.

#2 @matt
16 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

The - trimming is the intended behaviour. Perhaps in the context of MT or Typepad which has a less intelligent slug method we should create some sort of 404 handler that redirect entries based on all the information it can gather from the URL.

Note: See TracTickets for help on using tickets.