Title: script-src-elem field generated wrong
Last modified: January 9, 2025

---

# script-src-elem field generated wrong

 *  Resolved [besite](https://wordpress.org/support/users/besite/)
 * (@besite)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/script-src-elem-field-generated-wrong/)
 * Hi,
 * When configuring CSP I stumbled upon a bug I think.
 * When the field: **script-src-elem** has a value, the value is seen in master.
   php but not in .htaccess.
 * It now gets the same value from **style-src-attr**.
 * Is it possible to get a fix for this?
 * Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/script-src-elem-field-generated-wrong/#post-18234806)
 * Hello [@besite](https://wordpress.org/support/users/besite/)
 * Thank you for reaching out and I am happy to help!
   Can you please share if you
   added the value in the Content Security Policy Report Only section or Content
   Security Policy?What are the values you added and if you check the source is 
   the **script-src-elem** added?
 * Thanks!
 *  Thread Starter [besite](https://wordpress.org/support/users/besite/)
 * (@besite)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/script-src-elem-field-generated-wrong/#post-18235157)
 * Hi, thank you for your quick reply.
 * Whenever I put the value “my-testing-value” inside **script-src-elem** and check
   master.php I see the following:
   `"browsercache.security.csp.scriptelem": "my-
   testing-value",`Which sounds about right, except when I open .htaccess I don’t
   see the `Header set Content-Security-Policy`
 * Whenever I put the value` my-testing-value-2` inside the field: **style-src-attr**:
   
   I get this results which is want I want:`Header set Content-Security-Policy "
   script-src-elem my-testing-value-2"`
 * So what I see is the script-src-elem is not generator correcly to the htaccess
   and the style-src-attr is used for the value of script-src-elem.
 * I hope I made myself clear. If you need more info let me know.
 * Thank you
 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/script-src-elem-field-generated-wrong/#post-18236698)
 * Hello [@besite](https://wordpress.org/support/users/besite/)
 * Thank you for the clarification.
   Let me make some tests and try to replicate 
   this and I’ll get back to you once I have more infoThanks!
 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/script-src-elem-field-generated-wrong/#post-18248400)
 * Hello [@besite](https://wordpress.org/support/users/besite/)
 * We do have a [ticket for this in our GitHub Repository](https://github.com/BoldGrid/w3-total-cache/issues/995)
 * Please make sure to check the progress and add any additiona information there
 * Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘script-src-elem field generated wrong’ is closed to new replies.

 * ![](https://ps.w.org/w3-total-cache/assets/icon-256x256.png?rev=1041806)
 * [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/w3-total-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/w3-total-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/w3-total-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/w3-total-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/w3-total-cache/reviews/)

## Tags

 * [CSP](https://wordpress.org/support/topic-tag/csp/)

 * 4 replies
 * 2 participants
 * Last reply from: [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * Last activity: [1 year, 4 months ago](https://wordpress.org/support/topic/script-src-elem-field-generated-wrong/#post-18248400)
 * Status: resolved