Skip to content

Update kses.php to allow HTML tags that contain colons like <esi:include>#4926

Closed
alewolf wants to merge 3 commits intoWordPress:trunkfrom
alewolf:trunk
Closed

Update kses.php to allow HTML tags that contain colons like <esi:include>#4926
alewolf wants to merge 3 commits intoWordPress:trunkfrom
alewolf:trunk

Conversation

@alewolf
Copy link
Copy Markdown

@alewolf alewolf commented Jul 28, 2023

This allows HTML tag names that contain a colon such as <esi:include>

The changed regex now allows zero or one colon within the tag name.

(<esi:include> tags are specified by the ESI Languages Specification: https://www.w3.org/TR/esi-lang/)

Trac ticket: https://core.trac.wordpress.org/ticket/58921


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

This allows HTML tag names that contain a colon such as <esi:include>

(Those tags are specified by the ESI Languages Specification: https://www.w3.org/TR/esi-lang/)
@alewolf
Copy link
Copy Markdown
Author

alewolf commented Jul 28, 2023

Here's the regex on regex101.com if you like to investigate it further: https://regex101.com/r/CdS2U2/1

Bear in mind that I had to add one backslash to make it work in regex101. The backslash is not necessary in the PHP code.

Regex101 code: `^<\s*(/\s*)?([a-zA-Z0-9-]+:?+[a-zA-Z0-9-]*)([^>]*)>?$`
PHP code:      `^<\s*(\s*)?([a-zA-Z0-9-]+:?+[a-zA-Z0-9-]*)([^>]*)>?$`

@alewolf alewolf closed this by deleting the head repository Jul 29, 2023
@alewolf
Copy link
Copy Markdown
Author

alewolf commented Jul 29, 2023

I created a new PR for this that now includes a unit test: #4929

@martinkrcho
Copy link
Copy Markdown

@alewolf can you please close this PR in favor of #4929?

@alewolf
Copy link
Copy Markdown
Author

alewolf commented Jun 22, 2024

@martinkrcho How do you mean? It is already closed...

@martinkrcho
Copy link
Copy Markdown

Scratch that. I didn't realite it's already closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants