I think, but I am not fully sure, to have found a problem in setup.php which
could lead to undefined $wgContLang object under certain circumstances; pls.
correct me if I'm wrong.
The following part in setup.php can call User:loadFromSession() -- which can(!)
create a new User() w/o going via SpecialUserLogin -- without the proper or
provisional language settings, which leads to $wgContLang being undefined and to
some undefined user account settings.
I noticed this behaviour while playing with AuthPlugin.php, Auth->InitUser(),
User->InitUser and User->loadfromsession().
if( $wgCommandLineMode ) {
- Used for some maintenance scripts; user session cookies can screw things up
- when the database is in an in-between state.
$wgUser = new User();
} else {
$wgUser = User::loadFromSession();
}
I propose to move these lines in setup.php just a couple of lines below: AFTER
the language setting
This can be seen in attachment
http://bugzilla.wikimedia.org/attachment.cgi?id=398 [for
http://bugzilla.wikipedia.org/show_bug.cgi?id=1360 ] or here:
@@ -290,6 +291,14 @@
$wgContLang = setupLangObj( $wgContLangClass );
$wgContLang->initEncoding();
+if( $wgCommandLineMode ) {
+ # Used for some maintenance scripts; user session cookies can screw things up
+ # when the database is in an in-between state.
+ $wgUser = new User();
+} else {
+ $wgUser = User::loadFromSession();
+}
+
Version: 1.4.x
Severity: normal