fix: emit admin form script via SecureHtmlRenderer for CSP#6
Open
rhoerr wants to merge 2 commits into
Open
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 16, 2026
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
Makes the admin form template CSP-compliant: the inline
<script>block inservices.phtmlis now emitted viaSecureHtmlRenderer::renderTag()(heredoc-built script string, dynamic pieces precomputed into escaped PHP variables — the same pattern coreMagento/Configtemplates use), so Magento adds the CSP hash/nonce and strict-CSP admin (2.4.7+) no longer blocks it. JS logic is unchanged — this is a relocation, not a rewrite.Also carries the chain's CHANGELOG/README updates for all four follow-ups.
PR chain (stacked on #2; each retargets as its base merges): Grok/xAI dedupe →
api_keyrename → masked credentials → CSP. All are pre-1.0.0, so the breaking changes need no migration.Test plan
node --check, placeholder shown, no plaintext credentials in output.vendor/bin/phpcsexits 0 (avoidedob_start(), which the Magento2 standard flags).🤖 Generated with Claude Code