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

Datatables v2 does not work when $wgCSPHeader['useNonces'] = true #785

Closed
alistair3149 opened this issue Jul 28, 2023 · 0 comments · Fixed by #786
Closed

Datatables v2 does not work when $wgCSPHeader['useNonces'] = true #785

alistair3149 opened this issue Jul 28, 2023 · 0 comments · Fixed by #786

Comments

@alistair3149
Copy link
Contributor

Setup

  • MW version: 1.39.4
  • DB (MySQL etc.): 11.0.2-MariaDB-1:11.0.2+maria~ubu2204
  • PHP version: 8.1.21 (fpm-fcgi)
  • SMW version: 4.1.1
  • SRF version: 4.1.0-beta

Issue

image

Datatables v2 does not render when $wgCSPHeader['useNonces'] is set to true. It appears that the inline script added by ResourceFormatter.php does not include an nonce (nonce param in ResourceLoader::makeInlineScript is set to false (#397)).

Steps to reproduce

  1. Set $wgCSPHeader['useNonces'] to true in LocalSettings.php
  2. Use format=datatables in an ask inline query

Potential solution
ResourceLoader::makeInlineScript should include an nonce instead of setting it to false.

osnard pushed a commit to osnard/SemanticResultFormats that referenced this issue Nov 30, 2023
JeroenDeDauw pushed a commit that referenced this issue Nov 30, 2023
* Allow for NONCEs on inline scripts

In order to support CSP-Header.

See also
* 6e62a00
* #785

* Remove explicit removal of NONCEs

---------

Co-authored-by: rvogel <vogel@hallowelt.biz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant