Remove attribute only when necessary#1085
Merged
cure53 merged 1 commit intocure53:mainfrom Apr 11, 2025
Merged
Conversation
Owner
|
Oha, that looks very interesting, thanks a lot! We'll give it a spin. If all looks fine, we would release this as 3.3.0 as this might be a breaking change for some users. |
2 tasks
pparidans
added a commit
to odoo-dev/odoo
that referenced
this pull request
Sep 29, 2025
Note: due to the PR [1], the attributes' order is more predicatable, hence the tests adaptations. [1]: cure53/DOMPurify#1085 task-5110128
robodoo
pushed a commit
to odoo/odoo
that referenced
this pull request
Sep 30, 2025
Note: due to the PR [1], the attributes' order is more predicatable, hence the tests adaptations. [1]: cure53/DOMPurify#1085 task-5110128 closes #228417 Related: odoo/enterprise#95776 Signed-off-by: Aaron Bohy (aab) <[email protected]>
robodoo
pushed a commit
to odoo/odoo
that referenced
this pull request
Sep 30, 2025
Note: due to the PR [1], the attributes' order is more predicatable, hence the tests adaptations. [1]: cure53/DOMPurify#1085 task-5110128 closes #228417 Related: odoo/enterprise#95776 Signed-off-by: Aaron Bohy (aab) <[email protected]>
kmagusiak
pushed a commit
to odoo-dev/odoo
that referenced
this pull request
Oct 7, 2025
Note: due to the PR [1], the attributes' order is more predicatable, hence the tests adaptations. [1]: cure53/DOMPurify#1085 task-5110128 closes odoo#228417 Related: odoo/enterprise#95776 Signed-off-by: Aaron Bohy (aab) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The change is to make
_sanitizeAttributes()only remove an attribute if needed. The way that attributes are sanitized is not changed.Background & Context
This provides a performance benefit as attributes are not constantly removed and added back. It also prevents attribute re-ordering, making comparing the pre-sanitized and post-sanitzed content easier and simplifying writing tests. The engineers at Tiny have had a patch applied to dompurify with these changes in production for many years and would like to contribute the changes upstream.
Tests
As attributes are not removed and re-added, the original attribute order should be maintained after sanitization. As a result, the order of attributes in several tests has been updated. Nothing else about the test cases has been altered.
Tasks
Dependencies
N/A