Added code to check if a target page redirects to the current page, and
prevents linking to that target page. Note that this does not catch
situations where a page title exists twice, once with first capital letter
and once with first lowercase letter (should happen on test systems only).
The preg_replace_callback callback functions were removed as static
functions and declared inline; the callback function for $wgCapitalLinks ==
false was simplified to speed up the process.
The regular expression used to split the page content had a few pipe
characters in the wrong places, due to the previous 'cleaning-up' of the
convoluted expression for version 2.3.0.
If a page title started with a slash, the algorithm to deal with leading
capitals would produce a faulty regexp by accessing $escapedTitle[0] and
substr($escapedTitle, 1), which would only capture the slash that escapes
the slash.
Also fix small bug in template detection (make expression non-greedy).
Page titles are now properly escaped using preg_quote() to prevent regexp
compilation errors if the title contains characters with special meanings in
regular expressions.
If a page title does has a different case than an occurrence of the same
word(s) on the page that is being edited, the extension will now
automatically generate 'piped' links such as [[Linking titles|Linking
Titles]].