Skip to content

Revert form element escaping#196

Merged
nilmerg merged 3 commits intomainfrom
revert-form-element-escaping
Apr 17, 2026
Merged

Revert form element escaping#196
nilmerg merged 3 commits intomainfrom
revert-form-element-escaping

Conversation

@nilmerg
Copy link
Copy Markdown
Member

@nilmerg nilmerg commented Apr 16, 2026

It turned out to be rather problematic to implicitly escape every form element name as we cannot guarantee that element names are not programmatically constructed already.

Examples:

\ipl\Html\FormElement\CheckboxElement renders a hidden element representing its unchecked state and uses getValueOfNameAttribute to define the name for it. This is done to support fieldsets containing a checkbox element. Though, fieldsets require special element names and hence this results in an constructed name with brackets being used as literal and hence the hidden element escapes it.

Another case is when an element with an escaped name is also capable of auto-submitting the form. Icinga Web will transmit the name of such an element in a special http request header value and since we used invisible control characters to escape form element names, this resulted in invalid header values.

--

It's for these reasons that we decided to drop support for implicit form element name escaping again and require form implementors to safe-guard themselves by explicitly escaping their names. Form::escapeReservedChars() has been deprecated and triggers a deprecation notice if used from now on.

@nilmerg nilmerg added this to the v0.11.0 milestone Apr 16, 2026
@nilmerg nilmerg self-assigned this Apr 16, 2026
@cla-bot cla-bot Bot added the cla/signed label Apr 16, 2026
@nilmerg nilmerg requested a review from raviks789 April 16, 2026 13:48
raviks789
raviks789 previously approved these changes Apr 17, 2026
@nilmerg nilmerg force-pushed the revert-form-element-escaping branch from c29f888 to 33b3df7 Compare April 17, 2026 09:58
@nilmerg nilmerg requested a review from raviks789 April 17, 2026 09:58
@nilmerg
Copy link
Copy Markdown
Member Author

nilmerg commented Apr 17, 2026

__CLASS__ was superfluous in the deprecation notice.

@nilmerg nilmerg merged commit 9eef5be into main Apr 17, 2026
13 checks passed
@nilmerg nilmerg deleted the revert-form-element-escaping branch April 17, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants