Brion Vibber schrieb:
- It breaks template inclusions.
This *should* include a template: {{My template|value}}
but instead it sets the display title to "value".
My bad, fixed.
- Most of the time it won't have any effect.
For some reason it's trying to set $wgOut's global title setting from the parser.
Most page views come from the parser cache -- the parser *does not run* at the time when the user comes to look at it. It ran on a previous view, or when the page was saved, and any ephemeral changes to $wgOut have long ago vanished.
To be useful at all, it would have to save the value into the ParserOutput object, and it would have to be retrieved from that output object (either immediately-rendered or from the cache) at display time.
I'll work on that.
- It may have effect in places it shouldn't.
Previews, background rendering, display of message chunks inside a special page, etc might run the parser at many times other than a page view. This could lead to inappropriate overwriting of the special page's title information.
An immediate example is that the "Editing XYZ" message gets overwritten entirely when previewing.
I've limited it to "$action == 'view'". That leaves some special pages. I'll write a workaround.
Also I noticed a few weird bits in the code, such as this: $st .= str_replace ( "$1", $t, wfMsg('displaytitle') );
We removed this awkward construct a couple years ago, letting wfMsg() and friends accept parameters for replacements instead. It's generally much cleaner and more legible.
We have sooo many goodies nowadays, I keep forgetting... ;-) Anyway, fixed.
Magnus