WordPress.org

Make WordPress Core

Opened 13 months ago

Last modified 12 months ago

#44958 assigned defect (bug)

&nbsp character in title generates a permalink (and slug) with space

Reported by: ace2_heart Owned by:
Milestone: Awaiting Review Priority: normal
Severity: major Version: 4.8
Component: Permalinks Keywords: needs-testing reporter-feedback
Focuses: Cc:
PR Number:

Description

If a title has an &nbsp character copy pasted or if the permalink has a &nbsp copy pasted
It will generate a permalink and slug with an space breaking some elements on the site

I generated an empty wordpress install without any plugins to test it, and it has the same problem

Attachments (1)

5aeaf99417f517d3b1c9bb120a3713a8.gif (144.2 KB) - added by audrasjb 13 months ago.
Works for me

Download all attachments as: .zip

Change History (9)

#1 follow-up: @audrasjb
13 months ago

  • Keywords reporter-feedback added

Hi @ace2_heart thanks for the ticket and welcome to WordPress Trac,

I can't reproduce the issue on a fresh install (see screen capture above). I tested it in the permalink edition and in the title field and both are correctly escaping the non-breaking space. Can you provide us some further information to reproduce the bug please?

Cheers,

Jb

#2 @SergeyBiryukov
13 months ago

Hi @ace2_heart, thanks for the ticket!

  is supposed to be converted to a hyphen by sanitize_title_with_dashes().

Are you sure the issue still happens on a clean install with all plugins disabled and a default theme (Twenty Seventeen) activated?

Last edited 13 months ago by SergeyBiryukov (previous) (diff)

#3 @ace2_heart
13 months ago

Hi, I created an empty install here, you can access it

  • user: miguelesquirol
  • password: miguelesquirol

https://bug-testing-miguelesquirol.c9users.io/wp-ad- min

These are the pages created

The parmalink are as following:

/e -securite/
/ -test/
Last edited 13 months ago by ace2_heart (previous) (diff)

#4 in reply to: ↑ 1 @ace2_heart
13 months ago

Replying to audrasjb:

I just saw the demo you posted, instead of using the   text on the title, tried to copy/paste the actual space character.

e -securite

Hi @ace2_heart thanks for the ticket and welcome to WordPress Trac,

I can't reproduce the issue on a fresh install (see screen capture above). I tested it in the permalink edition and in the title field and both are correctly escaping the non-breaking space. Can you provide us some further information to reproduce the bug please?

Cheers,

Jb

#5 follow-up: @audrasjb
13 months ago

Ok thanks for your answer.

So the issue happens with control marks like %e2%80%. Indeed, I'm able to reproduce this specific issue.

By the way, you are running WP 4.8.7 which is quite an old version. But the issue also happens in 4.9.8.

Thanks,

Jb

#6 in reply to: ↑ 5 @ace2_heart
13 months ago

So it's a really a bug? It's my first time submitting one.

Replying to audrasjb:

Ok thanks for your answer.

So the issue happens with control marks like %e2%80%. Indeed, I'm able to reproduce this specific issue.

By the way, you are running WP 4.8.7 which is quite an old version. But the issue also happens in 4.9.8.

Thanks,

Jb

Last edited 13 months ago by ace2_heart (previous) (diff)

#7 @audrasjb
13 months ago

I'd say it's more like an edge case, but yep, thank you for your ticket :)

#8 @tsewlliw
12 months ago

I'm hoping to submit a patch for this ticket in the next couple of days, I have seen it pop up in other places with other characters with a clear case for being sanitized out of URIs, such as the unicode line separator.

Note: See TracTickets for help on using tickets.