| RequestHasSameOriginSecurity | |
|---|---|
| Available fromversion 1.27.0 Called to determine if the request is somehow flagged to lack same-origin security. | |
| Define function: | publicstaticfunctiononRequestHasSameOriginSecurity(WebRequest$request){...} |
| Attach hook: | Inextension.json:{"Hooks":{"RequestHasSameOriginSecurity":"MediaWiki\\Extension\\MyExtension\\Hooks::onRequestHasSameOriginSecurity"}} |
| Called from: | File(s):api/ApiMain.php Function(s):lacksSameOriginSecurity |
| Interface: | RequestHasSameOriginSecurityHook.php |
For more information about attaching hooks, seeManual:Hooks.
For examples of extensions using this hook, seeCategory:RequestHasSameOriginSecurity extensions.
Return false to indicate that the same-origin security is somehow lacked. Note if the "somehow" involves HTTP headers, you'll probably need to make sure the header is varied on.
This hook was added in a security patch and thus not available on Gerrit. It was added inhttps://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/9ec1ef7308acc0366e92f8e6af10ce3cb22b5065%5E%21/.
$request: The WebRequest object.