Manual:Hooks/BeforeHttpsRedirect

From Linux Web Expert

BeforeHttpsRedirect
<translate> Available from <tvar name=1><translate> version <tvar (Gerrit change 132952)</tvar></translate>
<translate> Removed in <tvar name=1><translate> version <tvar (Gerrit change 675293)</tvar></translate>
Called prior to forcing HTTP->HTTPS redirect. Use this hook to override how the redirect is output.
<translate> Define function:</translate>
public static function onBeforeHttpsRedirect( IContextSource $context, string &$redirect ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"BeforeHttpsRedirect": "MediaWiki\\Extension\\MyExtension\\Hooks::onBeforeHttpsRedirect"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> MediaWiki.php
<translate> Function(s):</translate> maybeDoHttpsRedirect
<translate> Interface:</translate> BeforeHttpsRedirectHook.php

<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:BeforeHttpsRedirect extensions</tvar>.</translate>


Details

  • $context: An IContextSource instance
  • &$redirect: A modifiable string URL

See also