2020-03-03 22:50:34 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace MediaWiki\Hook;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @stable for implementation
|
|
|
|
|
* @ingroup Hooks
|
|
|
|
|
*/
|
|
|
|
|
interface ContentSecurityPolicyScriptSourceHook {
|
|
|
|
|
/**
|
2020-03-16 23:31:05 +00:00
|
|
|
* Use this hook to modify the allowed CSP script sources.
|
2020-03-03 22:50:34 +00:00
|
|
|
* Note that you also have to use ContentSecurityPolicyDefaultSource if you
|
2020-03-16 23:31:05 +00:00
|
|
|
* want non-script sources to be loaded from whatever you add.
|
2020-03-03 22:50:34 +00:00
|
|
|
*
|
|
|
|
|
* @since 1.35
|
|
|
|
|
*
|
2020-04-20 06:03:16 +00:00
|
|
|
* @param string[] &$scriptSrc Array of CSP directives
|
2020-03-16 23:31:05 +00:00
|
|
|
* @param array $policyConfig Current configuration for the CSP header
|
|
|
|
|
* @param string $mode ContentSecurityPolicy::REPORT_ONLY_MODE or
|
2020-03-03 22:50:34 +00:00
|
|
|
* ContentSecurityPolicy::FULL_MODE depending on type of header
|
|
|
|
|
* @return bool|void True or no return value to continue or false to abort
|
|
|
|
|
*/
|
|
|
|
|
public function onContentSecurityPolicyScriptSource( &$scriptSrc,
|
|
|
|
|
$policyConfig, $mode
|
|
|
|
|
);
|
|
|
|
|
}
|