Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#49337 closed defect (bug) (invalid)

Post title changed after publication if a <tag> is found by adding </tag>

Reported by: casiepa's profile casiepa Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords:
Focuses: Cc:

Description

WordPress 5.3.2
Theme Twenty Twenty

A post title of

Bert & Ernie’s <banana> festi­­val

becomes

Bert & Ernie’s festi­­val

on the frontend after publication and gets a slug of bert-ernies-festival

The backend is keeping the full title with the <banana> inside when I check the posts.

  1. Where did the banana go in displaying the title (or is this 2020 issue?)
  2. Should the slug not be picking up words that are non existing tags? A post with just <whatever> as a title will result in post slug '123' (the post ID)

Thanks!

Change History (2)

#1 @ocean90
4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed
  • Version 5.3.2 deleted

Users with administrator or editor roles are allowed to use HTML in post titles. In your case <banana> is a HTML tag and will be rendered as such by the browser. Browser are also trying to fix invalid HTML and makes it <banana>festi­­val</banana>.

If you want to have the tag rendered as a string (and used in the slug) you have to use HTML entities: &lt;banana&gt;.

#2 @SergeyBiryukov
4 years ago

  • Component changed from General to Posts, Post Types

Related: #17648

Note: See TracTickets for help on using tickets.