| 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 "ContentSecurityPolicyDefaultSource" to register handlers implementing this interface. |
| 8 | * |
| 9 | * @stable to implement |
| 10 | * @ingroup Hooks |
| 11 | */ |
| 12 | interface ContentSecurityPolicyDefaultSourceHook { |
| 13 | /** |
| 14 | * Use this hook to modify the allowed CSP load sources. This affects all |
| 15 | * directives except for the script directive. To add a script source, see |
| 16 | * ContentSecurityPolicyScriptSource hook. |
| 17 | * |
| 18 | * @since 1.35 |
| 19 | * |
| 20 | * @param string[] &$defaultSrc Array of Content-Security-Policy allowed sources |
| 21 | * @param array $policyConfig Current configuration for the Content-Security-Policy header |
| 22 | * @param int $mode ContentSecurityPolicy::REPORT_ONLY_MODE or |
| 23 | * ContentSecurityPolicy::FULL_MODE depending on type of header |
| 24 | * @return bool|void True or no return value to continue or false to abort |
| 25 | */ |
| 26 | public function onContentSecurityPolicyDefaultSource( &$defaultSrc, |
| 27 | $policyConfig, $mode |
| 28 | ); |
| 29 | } |