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
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
Set $wgCSPHeader['useNonces'] to true in LocalSettings.php
Setup
Issue
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 inResourceLoader::makeInlineScript
is set tofalse
(#397)).Steps to reproduce
$wgCSPHeader['useNonces']
totrue
in LocalSettings.phpformat=datatables
in an ask inline queryPotential solution
ResourceLoader::makeInlineScript
should include an nonce instead of setting it to false.