Unstub $wgLang for PageContentLanguage hook
authorNiklas Laxström <niklas.laxstrom@gmail.com>
Thu, 7 Mar 2019 11:34:26 +0000 (12:34 +0100)
committerNiklas Laxström <niklas.laxstrom@gmail.com>
Thu, 16 May 2019 16:49:53 +0000 (18:49 +0200)
commit855b1794b6b7761260702a394414876eefc6cc0f
tree4300b93e2e88c6669c41f687446f1694c55cf3b3
parent18a53cb48bc5848e490f3bc1c444e26ef8bc8299
Unstub $wgLang for PageContentLanguage hook

This is to avoid annoying fatal errors when someone annotated their
hook handler to only expect Language objects, but that expectation
is violated due to this code possibly passing StubUserLang to hooks,
some of which may also assign it to $pageLang.

Even with this in place, it is probably a good idea for hook handlers
to refrain from type hinting parameters that are passed by reference
because their types cannot be guaranteed.

Bug: T214358
Change-Id: I88405a8de4b13675eb5a9d11e9ddc87e20a85fb4
docs/hooks.txt
includes/content/ContentHandler.php