WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 20 months ago

#40191 new defect (bug)

Multiline post content with `<` as first character becomes malformed

Reported by: johnjamesjacoby Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Formatting Keywords:
Focuses: Cc:
PR Number:

Description

Create a page/post with the following content:

< Hello
< Hello
< Hello

View the post, and post_content becomes:

< Hello < Hello < Hello

Change History (2)

#1 @johnjamesjacoby
3 years ago

I've narrowed it down to:

  • wpautop()
  • wp_replace_in_html_tags()
  • wp_html_split()
  • get_html_split_regex()

Something is up with how get_html_split_regex() identifies HTML tags.


< 1
< 2
< 3

gets treated differently than:

> 1
> 2
> 3

#2 @soulseekah
20 months ago

That is not valid HTML. &lt; should be used.

Related #39153

Note: See TracTickets for help on using tickets.