Last modified: 2010-05-15 15:33:13 UTC
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(); +} +
Removing from 1.5 blockers as nothing in 1.5 should actually be affected by it; the language object is only hit for default settings for anon users, and there was a hackaround for that which worked already. Moving to code quality (bug 700) instead, and resolving as FIXED for 1.5 in CVS HEAD.
Also reported as http://bugzilla.wikimedia.org/show_bug.cgi?id=3426 Variable wgContLang is null in ObjectCache.php and Title.php. Not sure, whether it is a real duplicate.