Parser::replaceInternalLinks: fix batching
authorKevin Israel <pleasestand@live.com>
Tue, 15 Oct 2013 13:42:48 +0000 (09:42 -0400)
committerTim Starling <tstarling@wikimedia.org>
Wed, 23 Oct 2013 05:48:24 +0000 (05:48 +0000)
commit940fb88ba44d670d5fc12fa2e58e684ff41c3fdc
tree63490f57171ce7f6f773bedc63b4c4b74fed1f91
parent33c5d1dbcf69a83ab60be3a2c180ae091072c580
Parser::replaceInternalLinks: fix batching

The parser unnecessarily made individual checks for existence of
pages that were neither in LinkCache nor linked only with a fragment.
A Title::isKnown() call in Parser::replaceInternalLinks2() (added in
bca8b8ad7d2f) caused this.

Title::isKnown() was used to avoid treating a link to a distinct page
as a self-link even when the title happened to match one of the variants
returned by Language::autoConvertToAllVariants(). This change fixes
the bug by moving the problematic portion of the self-link check into
LinkHolderArray::doVariants().

Change-Id: I586e11e8b47308980ea04087ebc4246c397a8f53
includes/parser/LinkHolderArray.php
includes/parser/Parser.php
tests/parser/parserTests.txt