$wgTitle is by far the most evil global we have. It needs to go away. It constantly gets in the way of doing things properly, and people use it not knowing how bad it is.
Suggest we make killing this a higher priority. Other globals are bad too, but this one is really really bad.
There are various places across MW core and extensions that only set $wgTitle, not read from it. These are harmless enough.
More problematic are the remaining cases where code reads from $wgTitle:
MediaWiki core
- Linker - used in the deprecated function Linker::makeExternalLink. Action required - remove uses of this function from extensions.
- MessageCache - logged in the GlobalTitleFail log
- RequestContext - logged in the GlobalTitleFail log
- CommentParser - not logged. $wgTitle is used when various CommentFormatter method are called with $selfLinkTarget === null. Action required - deprecate null parameter values in CommentFormatter?
WMF-deployed extensions
Note that the last two instances are in FormatAutocomments hooks. That hook may need improving so that the $title parameter is never null, or is null in fewer scenarios.
Non-WMF-deployed extensions