Don't use SearchEngineConfig::searchableNamespaces in User::getDefaultOptions.
authordaniel <daniel.kinzler@wikimedia.de>
Sat, 6 Aug 2016 13:25:06 +0000 (15:25 +0200)
committerDaniel Kinzler <daniel.kinzler@wikimedia.de>
Sat, 6 Aug 2016 14:56:23 +0000 (14:56 +0000)
commit00e6f58461b39ce523813683b57b0ae90ed5f589
tree6006abc107a97a2810080043257a195f998479f6
parent3dcd1766aa6c5a762def8b9c0d302cb35e5cc482
Don't use SearchEngineConfig::searchableNamespaces in User::getDefaultOptions.

Default options should be the same for all users. SearchEngineConfig::searchableNamespaces
however calls a hok that allows the set of searchable namespaces to be adjusted per user,
e.g. based on the user groups or permissions, like Extension:Lockdown does.

Since SearchableNamespace hook handlers may access the global user objects, problems arise
when it is that global user object trying to initialize itself that triggers the call to
User::getDefaultOptions. This can cause recursive calls to User::load(), see I6d1b9fe07.

Furthermore, these seems to be no need to actively record the searchable namespaces beyond
the contents of $wgNamespacesToBeSearchedDefault. If a 'searchNs' option is absent, it is
treated as disabled.

Bug: T142295
Bug: T137051
Change-Id: I5f6bcdfc588acef0873136bf338d79890863e009
includes/user/User.php