Move redirect rendering into WikitextContent
authorBrad Jorsch <bjorsch@wikimedia.org>
Sat, 4 Jan 2014 22:07:33 +0000 (17:07 -0500)
committerBrad Jorsch <bjorsch@wikimedia.org>
Tue, 7 Jan 2014 14:18:22 +0000 (09:18 -0500)
commitd8b1b79ea423ef3391c34f63aa382fd6bad6597e
tree7aa3ac24f1b3bed62070e95ad41d9e94ac3f1101
parente71579d747a517e0d74dc8f852a115ed2fdf523d
Move redirect rendering into WikitextContent

There's no good reason for everything that wants to render a page to
have to test whether the page is a redirect and then call
Article::viewRedirect to get the fancy rendering instead of using the
ParserOutput. This logic can easily be moved into
WikitextContent::getParserOutput so callers can just use the
returned ParserOutput.

At the same time, we can handle "#REDIRECT [[File:Foo]]" and
"#REDIRECT [[Category:Foo]]" the way people expect, by recording the
link in pagelinks rather than imagelinks/categorylinks (although this
means fixing ImagePage's bug about assuming anything in imagelinks that
is a redirect is a redirect to the image too).

And we can finally fix bug 14323, too.

Bug: 14323
Bug: 17259
Bug: 27621
Bug: 42642
Bug: 50488
Change-Id: Id44d566a7ca35a1b9579d0c0e947877c980b0686
Followup: I1c7582d1bf7ec4184a45b00154e3dd5b39dd444b
Followup: I3653b608941813a73281f4f0545bea2487d43964
RELEASE-NOTES-1.23
includes/Article.php
includes/EditPage.php
includes/ImagePage.php
includes/content/WikitextContent.php
includes/diff/DifferenceEngine.php