MessageCache: Don't get a ParserOptions for $wgUser before the end of Setup.php
Until Setup.php completes, we can't access the "current" user and trying to do so logs a warning. So don't try. Bug: T124367 Change-Id: If31230407829c04f34d9cfefcbb97edacb949b6d
This commit is contained in:
parent
2dd27a8257
commit
058aec4c76
1 changed files with 11 additions and 0 deletions
11
includes/cache/MessageCache.php
vendored
11
includes/cache/MessageCache.php
vendored
|
|
@ -168,7 +168,18 @@ class MessageCache {
|
|||
* @return ParserOptions
|
||||
*/
|
||||
function getParserOptions() {
|
||||
global $wgFullyInitialised, $wgContLang;
|
||||
|
||||
if ( !$this->mParserOptions ) {
|
||||
if ( !$wgFullyInitialised ) {
|
||||
// $wgUser isn't unstubbable yet, so don't try to get a
|
||||
// ParserOptions for it. And don't cache this ParserOptions
|
||||
// either.
|
||||
$po = new ParserOptions( new User, $wgContLang );
|
||||
$po->setEditSection( false );
|
||||
return $po;
|
||||
}
|
||||
|
||||
$this->mParserOptions = new ParserOptions;
|
||||
$this->mParserOptions->setEditSection( false );
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue