Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSP add custom attribute on generated <style> tag #20309

Open
nzwz opened this issue Jan 14, 2025 · 0 comments
Open

CSP add custom attribute on generated <style> tag #20309

nzwz opened this issue Jan 14, 2025 · 0 comments

Comments

@nzwz
Copy link

nzwz commented Jan 14, 2025

We'd like to add the ability to add custom attributes to rendered <style> tags; similar to #20087

This is to allow CSP nonces to be added to <style> tags, as they currently are for <script> tags.

What steps will reproduce the problem?

Html::style('.class { display:none; }')

Outputs

<style>
.class { display:none; }
</style>

What is the expected result?

need an attribute to tag style for content security policy (csp)

<style nonce="key">
.class { display:none; }
</style>

What do you get instead?

<style>
.class { display:none; }
</style>

Additional info

Q A
Yii version 2.0.51
PHP version 8.3
Operating system MacOS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants