Last modified: 2014-07-01 20:23:54 UTC
$this->mTitle has been introduced to Parser and EditPage quite some time ago, and most of its members use it. Some member functions insist on using $wgTitle, however, which is not only incorrect but breaks the API. I'm personally starting a crusade against $wgTitle in these two classes, but maybe others could start similar crusades against global variables in code segments they know well.
Parser only uses $wgTitle when the relevant entry point does not provide a title in a parameter. For robustness, the API should set $wgTitle.
(In reply to comment #1) > Parser only uses $wgTitle when the relevant entry point does not provide a > title in a parameter. I found one instance in which it didn't (see r29918), I don't know if there are more. > For robustness, the API should set $wgTitle. True, but classes like Parser and EditPage should be usable on pages different from $wgTitle as well, and therefore shouldn't rely on it.
(In reply to comment #2) > (In reply to comment #1) > > Parser only uses $wgTitle when the relevant entry point does not provide a > > title in a parameter. > I found one instance in which it didn't (see r29918), I don't know if there are > more. > Found another one, see bug 16129 comment #3. > > For robustness, the API should set $wgTitle. > True, but classes like Parser and EditPage should be usable on pages different > from $wgTitle as well, and therefore shouldn't rely on it. > Bumping this point.