| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Hook; |
| 4 | |
| 5 | /** |
| 6 | * This is a hook handler interface, see docs/Hooks.md. |
| 7 | * Use the hook name "ContentSecurityPolicyDirectives" to register handlers implementing this interface. |
| 8 | * |
| 9 | * @stable to implement |
| 10 | * @ingroup Hooks |
| 11 | */ |
| 12 | interface ContentSecurityPolicyDirectivesHook { |
| 13 | /** |
| 14 | * If ContentSecurityPolicyDefaultSource and ContentSecurityPolicyScriptSource |
| 15 | * do not meet your needs, use this hook to modify the content security policy directives. |
| 16 | * |
| 17 | * @since 1.35 |
| 18 | * |
| 19 | * @param string[] &$directives Array of CSP directives |
| 20 | * @param array $policyConfig Current configuration for the CSP header |
| 21 | * @param int $mode ContentSecurityPolicy::REPORT_ONLY_MODE or |
| 22 | * ContentSecurityPolicy::FULL_MODE depending on type of header |
| 23 | * @return bool|void True or no return value to continue or false to abort |
| 24 | */ |
| 25 | public function onContentSecurityPolicyDirectives( &$directives, $policyConfig, |
| 26 | $mode |
| 27 | ); |
| 28 | } |