Remove inline handlers in cart, payment account page #2536
Merged
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.
What?
Per PCI, inline event handlers like
onload
,onclick
,onsubmit
, etc, are forbidden for security reasons. Instead of doing this, we should attach the relevant handlers via a trusted script (protected by nonce)This PR removes the following inline event handlers in order to comply with PCI since they are executed on pages that fall under PCI compliance (the Cart page and the Payments Account page)
confirm
dialog that is currently handled inline. I've switched this to an event listener instead throughcart.js
, which is already protected by noncenonce
Requirements
Screenshots (if appropriate)
Cart Gift Wrapping Option Testing
Confirm dialog pops up
After confirm, page is reloaded and message appears
Quick search
Search correctly previews results
Search works after pressing enter
Main Bundle
The relevant handler for the bundle is attached and executed correctly