Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#49337 closed defect (bug) (invalid)

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

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

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
7 years ago

  • Milestone Awaiting Review
  • Resolutioninvalid
  • Status newclosed
  • Version 5.3.2

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
7 years ago

  • Component GeneralPosts, Post Types

Related: #17648

Note: See TracTickets for help on using tickets.