Skip to content

allow ESI tags like <esi:include>#4929

Open
alewolf wants to merge 7 commits intoWordPress:trunkfrom
alewolf:trunk
Open

allow ESI tags like <esi:include>#4929
alewolf wants to merge 7 commits intoWordPress:trunkfrom
alewolf:trunk

Conversation

@alewolf
Copy link
Copy Markdown

@alewolf alewolf commented Jul 29, 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/)

Here's the regex on regex101.com if you like to investigate it further: https://regex101.com/r/qujMNv/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-:]+)([^>]*)>?$`
PHP code:      `^<\s*(/\s*)?([a-zA-Z0-9-:]+)([^>]*)>?$`

(This PR replaces the PR #4926)

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.

@alewolf alewolf changed the title allow colons in HTML tags like <esi:include> allow ESI tags like <esi:include> Jul 30, 2023
@martinkrcho martinkrcho mentioned this pull request Jun 21, 2024
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.

1 participant