Jump to content

Manual:Hooks/ImgAuthModifyHeaders

From mediawiki.org
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
ImgAuthModifyHeaders
Available from version 1.34.0 (Gerrit change 496705)
Executed just before a file is streamed to a user, allowing headers to be modified beforehand.
Define function:
public static function onImgAuthModifyHeaders( \MediaWiki\Linker\LinkTarget $title, array &$headers ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"ImgAuthModifyHeaders": "MediaWiki\\Extension\\MyExtension\\Hooks::onImgAuthModifyHeaders"
	}
}
Called from: File(s): ../img_auth.php
Function(s): wfImageAuthMain
Interface: ImgAuthModifyHeadersHook.php

For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:ImgAuthModifyHeaders extensions.


Details

  • $title: MediaWiki\Linker\LinkTarget instance
  • &$headers: Associative array of HTTP headers