Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(compiler): restrict possible event handler check to property names longer than 2 characters - #69306

Merged
thePunderWoman merged 1 commit into
angular:mainfrom
alan-agius4:fix-i18n-event-handler-length-check
Jun 15, 2026
Merged

fix(compiler): restrict possible event handler check to property names longer than 2 characters#69306
thePunderWoman merged 1 commit into
angular:mainfrom
alan-agius4:fix-i18n-event-handler-length-check

Conversation

@alan-agius4

Copy link
Copy Markdown
Contributor

Previously, the compiler disallowed translation of any attribute starting with 'on' for security reasons. This incorrectly disallowed translation of the 'on' attribute itself, which is not an event handler.

This commit introduces isPossibleEventHandler to verify that the property name has a length greater than 2 in addition to starting with 'on'. This allows attributes like 'on' to be translated while still correctly disallowing actual event handlers like 'onerror', 'onclick', etc.

@alan-agius4
alan-agius4 requested a review from JeanMeche June 11, 2026 07:44
@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Jun 11, 2026
@pullapprove
pullapprove Bot requested a review from josephperrott June 11, 2026 07:44
@angular-robot angular-robot Bot added the area: compiler Issues related to `ngc`, Angular's template compiler label Jun 11, 2026
@ngbot ngbot Bot added this to the Backlog milestone Jun 11, 2026
…s longer than 2 characters

Previously, the compiler disallowed translation of any attribute starting with 'on' for security reasons. This incorrectly disallowed translation of the 'on' attribute itself, which is not an event handler.

This commit introduces `isPossibleEventHandler` to verify that the property name has a length greater than 2 in addition to starting with 'on'. This allows attributes like 'on' to be translated while still correctly disallowing actual event handlers like 'onerror', 'onclick', etc.

@josephperrott josephperrott left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pullapprove
pullapprove Bot requested a review from josephperrott June 11, 2026 14:43

@josephperrott josephperrott left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Reviewed-for: fw-security

@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jun 15, 2026

@pkozlowski-opensource pkozlowski-opensource left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Reviewed-for: fw-security

@thePunderWoman
thePunderWoman merged commit 417a407 into angular:main Jun 15, 2026
30 of 31 checks passed
@thePunderWoman

Copy link
Copy Markdown
Contributor

This PR was merged into the repository. The changes were merged into the following branches:

@angular-automatic-lock-bot

Copy link
Copy Markdown

This pull request has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Jul 16, 2026
@alan-agius4
alan-agius4 deleted the fix-i18n-event-handler-length-check branch July 28, 2026 10:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: compiler Issues related to `ngc`, Angular's template compiler target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants