mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-11-28 08:10:45 +00:00
Added X-XSS-Protection header support
This commit is contained in:
parent
24b74796f4
commit
286c2d5acc
|
@ -80,6 +80,12 @@ WIP section, refer to below:
|
|||
"descriptionmsg": "citizen-config-enabledenyxframeoptions",
|
||||
"public": true
|
||||
},
|
||||
"EnableXXSSProtection": {
|
||||
"value": false,
|
||||
"description": "Enable or disable the X-XSS-Protection header",
|
||||
"descriptionmsg": "citizen-config-enablexxssprotection",
|
||||
"public": true
|
||||
},
|
||||
"EnableFeaturePolicy": {
|
||||
"value": false,
|
||||
"description": "Enable or disable Feature Policy",
|
||||
|
|
|
@ -44,6 +44,9 @@ class SkinCitizen extends SkinTemplate {
|
|||
// Deny X-Frame-Options
|
||||
$this->addXFrameOptions();
|
||||
|
||||
// X-XSS-Protection
|
||||
$this->addXXSSProtection();
|
||||
|
||||
// Feature policy
|
||||
$this->addFeaturePolicy();
|
||||
|
||||
|
@ -165,6 +168,16 @@ class SkinCitizen extends SkinTemplate {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Adds the X-XSS-Protection header if set in 'CitizenEnableXXSSProtection'
|
||||
*/
|
||||
private function addXXSSProtection() {
|
||||
if ( $this->getConfigValue( 'CitizenEnableXXSSProtection' ) === true ) {
|
||||
$this->out->getRequest()->response()->header( 'X-XSS-Protection: 1; mode=block' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the Feature policy header to the response if enabled in 'CitizenFeaturePolicyDirective'
|
||||
*/
|
||||
|
|
|
@ -81,6 +81,12 @@
|
|||
"descriptionmsg": "citizen-config-enabledenyxframeoptions",
|
||||
"public": true
|
||||
},
|
||||
"EnableXXSSProtection": {
|
||||
"value": false,
|
||||
"description": "Enable or disable the X-XSS-Protection header",
|
||||
"descriptionmsg": "citizen-config-enablexxssprotection",
|
||||
"public": true
|
||||
},
|
||||
"EnableFeaturePolicy": {
|
||||
"value": false,
|
||||
"description": "Enable or disable Feature Policy",
|
||||
|
|
Loading…
Reference in a new issue